]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
More fixes for url parsing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 Nov 2015 13:56:35 +0000 (13:56 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 Nov 2015 13:56:35 +0000 (13:56 +0000)
Hello my dear spammer, thank you for all your valueable test cases that you
are kindly providing for me!

src/libserver/url.c

index b1e1793c2883404b91d633d57959dd0f01d28d6f..7d9b7a9eb8cfe9706dc6b6b3f01b845371098895 100644 (file)
@@ -856,6 +856,18 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len,
                                        c = p + 1;
                                        st = parse_query;
                                }
+                               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_part;
+                               }
                                else if (!g_ascii_isdigit (t)) {
                                        if (strict || !g_ascii_isspace (t)) {
                                                goto out;