summaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-17 14:11:48 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-17 14:11:48 +0100
commitd4216edbf2af2d8347e5669dc73dd019a6ca95d0 (patch)
treed319498ab16c42519d2515b2554fac679f18a95d /src/libutil
parent68a41d5fcfbe71682696c5118732e9453cea7361 (diff)
downloadrspamd-d4216edbf2af2d8347e5669dc73dd019a6ca95d0.tar.gz
rspamd-d4216edbf2af2d8347e5669dc73dd019a6ca95d0.zip
[Minor] Another attempt to fix path normalisation
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/http.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index a5133695b..03dbaa7bd 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -3780,12 +3780,9 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, guint *nlen)
if (((o > path && *(o - 1) != '/') || (o == path)) && slash) {
/* Preserve one slash */
*o++ = '/';
- slash = p;
- }
- else {
- slash = NULL;
}
+ slash = p;
dot = NULL;
/* Ignore last slash */
state = st_normal;
@@ -3797,7 +3794,7 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, guint *nlen)
else {
/* We have something like .some or /.some */
if (dot && p > dot) {
- if (slash == dot - 1) {
+ if (slash == dot - 1 && (o > path && *(o - 1) != '/')) {
/* /.blah */
memmove (o, slash, p - slash);
o += p - slash;