From: Vsevolod Stakhov Date: Tue, 17 Apr 2018 11:28:18 +0000 (+0100) Subject: [Fix] Fix slash + dot in urls X-Git-Tag: 1.7.4~85 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dc38d08c27d49a3e95d65f1445457f7489b6b599;p=rspamd.git [Fix] Fix slash + dot in urls Issue: #2181 --- 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;