diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-01 16:34:14 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-01 16:34:14 +0100 |
commit | 09f370a1cdd54c889facb5633a678acf749ca7f7 (patch) | |
tree | 1c462c95a5e4aa53abb8645cccb7c3ab47632262 /src | |
parent | 6f5388b87b253f0babeaef680f376869ad4e10c4 (diff) | |
download | rspamd-09f370a1cdd54c889facb5633a678acf749ca7f7.tar.gz rspamd-09f370a1cdd54c889facb5633a678acf749ca7f7.zip |
Fix parsing of multiple slashes in URL.
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/url.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c index 5eccdebae..2de64cb33 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -451,10 +451,14 @@ rspamd_mailto_parse (struct http_parser_url *u, const gchar *str, gsize len, st = parse_prefix_question; p ++; } - else { + else if (t != '/') { c = p; st = parse_user; } + else { + /* Skip multiple slashes */ + p ++; + } break; case parse_prefix_question: if (t == 't') { @@ -608,14 +612,21 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, p ++; break; case parse_slash_slash: - c = p; - st = parse_domain; - slash = p; - if (*p == '[') { - st = parse_ipv6; - p ++; + if (t != '/') { c = p; + st = parse_domain; + slash = p; + + if (*p == '[') { + st = parse_ipv6; + p ++; + c = p; + } + } + else { + /* Skip multiple slashes */ + p ++; } break; case parse_ipv6: |