aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-24 14:07:11 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-24 14:07:11 +0000
commit8505221b7161ba62c5a69b08e34462b0e0020984 (patch)
tree9c4f9d9d3ab1eecb2324018670108f510ed88886 /src
parent66fdf123b1368907fa65bd6db9a6864cb8be63f3 (diff)
downloadrspamd-8505221b7161ba62c5a69b08e34462b0e0020984.tar.gz
rspamd-8505221b7161ba62c5a69b08e34462b0e0020984.zip
[Fix] More fixes for URLs with backslashes
Diffstat (limited to 'src')
-rw-r--r--src/libserver/url.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index 1afde3b6b..f4f07d4bd 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -119,14 +119,22 @@ struct url_matcher static_matchers[] = {
/* Common prefixes */
{"file://", "", url_file_start, url_file_end,
0, 0},
+ {"file:\\\\", "", url_file_start, url_file_end,
+ 0, 0},
{"ftp://", "", url_web_start, url_web_end,
0, 0},
+ {"ftp:\\\\", "", url_web_start, url_web_end,
+ 0, 0},
{"sftp://", "", url_web_start, url_web_end,
0, 0},
{"http://", "", url_web_start, url_web_end,
0, 0},
+ {"http:\\\\", "", url_web_start, url_web_end,
+ 0, 0},
{"https://", "", url_web_start, url_web_end,
0, 0},
+ {"https:\\\\", "", url_web_start, url_web_end,
+ 0, 0},
{"news://", "", url_web_start, url_web_end,
0, 0},
{"nntp://", "", url_web_start, url_web_end,
@@ -543,7 +551,7 @@ rspamd_mailto_parse (struct http_parser_url *u, const gchar *str, gsize len,
p++;
break;
case parse_semicolon:
- if (t == '/') {
+ if (t == '/' || t == '\\') {
st = parse_slash;
p++;
}
@@ -552,7 +560,7 @@ rspamd_mailto_parse (struct http_parser_url *u, const gchar *str, gsize len,
}
break;
case parse_slash:
- if (t == '/') {
+ if (t == '/' || t == '\\') {
st = parse_slash_slash;
}
else {
@@ -565,7 +573,7 @@ rspamd_mailto_parse (struct http_parser_url *u, const gchar *str, gsize len,
st = parse_prefix_question;
p++;
}
- else if (t != '/') {
+ else if (t != '/' && t != '\\') {
c = p;
st = parse_user;
}