diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-17 12:28:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-17 12:28:18 +0100 |
commit | dc38d08c27d49a3e95d65f1445457f7489b6b599 (patch) | |
tree | fa671bcc88c21cd37862ad5d869e0e37cb9a7209 /src | |
parent | 497376cd6c624dbe169ddfe0a1666f6c86390493 (diff) | |
download | rspamd-dc38d08c27d49a3e95d65f1445457f7489b6b599.tar.gz rspamd-dc38d08c27d49a3e95d65f1445457f7489b6b599.zip |
[Fix] Fix slash + dot in urls
Issue: #2181
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/http.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index c6b77ee15..ade3160cd 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -3794,8 +3794,15 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, guint *nlen) else { /* We have something like .some or /.some */ if (dot && p > dot) { - memmove (o, dot, p - dot); - o += p - dot; + if (slash == dot - 1) { + /* /.blah */ + memmove (o, slash, p - slash); + o += p - slash; + } + else { + memmove (o, dot, p - dot); + o += p - dot; + } } slash = NULL; |