From c038c0f72c64f532ce0f130137a5f98b61aec0e4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 1 Jul 2015 16:37:45 +0100 Subject: [PATCH] Fix parsing query just after port. --- src/libserver/url.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; -- 2.39.5