]> source.dussan.org Git - rspamd.git/commitdiff
Fix parsing query just after port.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 1 Jul 2015 15:37:45 +0000 (16:37 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 2 Jul 2015 10:42:09 +0000 (11:42 +0100)
src/libserver/url.c

index e5de2fc9800c75db7fef18907199a0ad4df4eb51..378929aa56fad92351559a31a3f5ac7971b4db5a 100644 (file)
@@ -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;