diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-30 11:20:49 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-30 11:26:10 +0100 |
commit | 8b66801d1a9a82fde251b321945091a153eeadbb (patch) | |
tree | 2b52b435e475812843e0eddf10d318cf5912973e /src/libserver/url.c | |
parent | 5adc1d807085ec9ca5eb5d58553c8e4129824ef8 (diff) | |
download | rspamd-8b66801d1a9a82fde251b321945091a153eeadbb.tar.gz rspamd-8b66801d1a9a82fde251b321945091a153eeadbb.zip |
[Minor] Try to deal with urls with backslashes in path
Diffstat (limited to 'src/libserver/url.c')
-rw-r--r-- | src/libserver/url.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c index ce98f0961..139252df4 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -1165,7 +1165,7 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, st = parse_port; c = p + 1; } - else if (*p == '/') { + else if (*p == '/' || *p == '\\') { st = parse_path; c = p + 1; } @@ -1309,11 +1309,11 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, /* Too large domain */ goto out; } - if (t == '/' || t == ':' || t == '?' || t == '#') { + if (t == '/' || t == '\\' || t == ':' || t == '?' || t == '#') { if (p - c == 0) { goto out; } - if (t == '/') { + if (t == '/' || t == '\\') { SET_U (u, UF_HOST); st = parse_suffix_slash; } @@ -1463,7 +1463,7 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, } break; case parse_port: - if (t == '/') { + if (t == '/' || t == '\\') { pt = strtoul (c, NULL, 10); if (pt == 0 || pt > 65535) { goto out; @@ -1515,7 +1515,7 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len, p++; break; case parse_suffix_slash: - if (t != '/') { + if (t != '/' && t != '\\') { c = p; st = parse_path; } |