From: Vsevolod Stakhov Date: Wed, 1 Jul 2015 15:37:45 +0000 (+0100) Subject: Fix parsing query just after port. X-Git-Tag: 0.9.9~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c038c0f72c64f532ce0f130137a5f98b61aec0e4;p=rspamd.git Fix parsing query just after port. --- diff --git a/src/libserver/url.c b/src/libserver/url.c index e5de2fc98..378929aa5 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -791,6 +791,18 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, } st = parse_suffix_slash; } + else if (t == '?') { + pt = strtoul (c, NULL, 10); + if (pt == 0 || pt > 65535) { + goto out; + } + if (u != NULL) { + u->port = pt; + } + + c = p + 1; + st = parse_query; + } else if (!g_ascii_isdigit (t)) { if (strict || !g_ascii_isspace (t)) { goto out;