]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix multiple @ at the beginnig
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 12 May 2021 16:16:36 +0000 (17:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 12 May 2021 16:16:36 +0000 (17:16 +0100)
src/libserver/url.c
test/lua/unit/url.lua

index 1fad034f5404def7611d68a2a398797c374e0461..2cfc7d147d76569bd89631e338e5f6e2e55e6903 100644 (file)
@@ -1225,7 +1225,11 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len,
                                }
 
                                /* For now, we ignore all that stuff as it is bogus */
+                               /* Off by one */
+                               p --;
                                SET_U (u, UF_USERINFO);
+                               p ++;
+                               *flags |= RSPAMD_URL_FLAG_HAS_USER;
                                st = parse_at;
                        }
                        else {
index 40d684bfc37638d9a41bc291951768e68b4e3aca..282d79290856780cad934cc3bf546b8d742b8ce3 100644 (file)
@@ -136,6 +136,9 @@ context("URL check functions", function()
     {"http:////$%^&****((@example.org//#f@f", true, {
       user = '$%^&****((', host = 'example.org', fragment = 'f@f'
     }},
+    {"http://@@example.com", true, {
+      user = "@", host = "example.com"
+    }}
   }
 
   -- Some cases from https://code.google.com/p/google-url/source/browse/trunk/src/url_canon_unittest.cc