From dc38d08c27d49a3e95d65f1445457f7489b6b599 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 17 Apr 2018 12:28:18 +0100 Subject: [PATCH] [Fix] Fix slash + dot in urls Issue: #2181 --- src/libutil/http.c | 11 +++++++++-- 1 file 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; -- 2.39.5