]> 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>
Wed, 1 Jul 2015 15:37:45 +0000 (16:37 +0100)
src/libserver/url.c

index 2de64cb3333dcd082a01b31db6b9eddb1efefd01..655f84a60cc4d3d31580a0e646af78fbeaedfd12 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;