diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-30 13:52:08 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-30 13:52:08 +0100 |
commit | 0250213db37ea12a4eafc7a29ade2c28fcc99015 (patch) | |
tree | 2b52b435e475812843e0eddf10d318cf5912973e /src/libserver/http | |
parent | 05d1951b5cfb9b72378eb3c1bdfdaa025b355789 (diff) | |
download | rspamd-0250213db37ea12a4eafc7a29ade2c28fcc99015.tar.gz rspamd-0250213db37ea12a4eafc7a29ade2c28fcc99015.zip |
Revert "[Minor] Implement backslashes replacement while we normalise http paths"
This reverts commit 05d1951b5cfb9b72378eb3c1bdfdaa025b355789.
Diffstat (limited to 'src/libserver/http')
-rw-r--r-- | src/libserver/http/http_util.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/libserver/http/http_util.c b/src/libserver/http/http_util.c index e6ba314d0..fd5adb3c1 100644 --- a/src/libserver/http/http_util.c +++ b/src/libserver/http/http_util.c @@ -312,8 +312,7 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, gsize *nlen) st_got_dot_dot, st_got_slash, st_got_slash_slash, - st_replace_backslash, - } state = st_normal, next_state; + } state = st_normal; p = path; end = path + len; @@ -330,11 +329,6 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, gsize *nlen) state = st_got_dot; dot = p; } - else if (G_UNLIKELY (*p == '\\')) { - state = st_replace_backslash; - next_state = st_normal; - continue; - } else { *o++ = *p; } @@ -346,11 +340,6 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, gsize *nlen) *o++ = *p; state = st_got_slash_slash; } - else if (G_UNLIKELY (*p == '\\')) { - state = st_replace_backslash; - next_state = st_got_slash; - continue; - } else if (G_UNLIKELY (*p == '.')) { dot = p; state = st_got_dot; @@ -386,11 +375,6 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, gsize *nlen) /* Ignore last slash */ state = st_normal; } - else if (G_UNLIKELY (*p == '\\')) { - state = st_replace_backslash; - next_state = st_got_dot; - continue; - } else if (*p == '.') { /* Double dot character */ state = st_got_dot_dot; @@ -452,11 +436,6 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, gsize *nlen) continue; } } - else if (G_UNLIKELY (*p == '\\')) { - state = st_replace_backslash; - next_state = st_got_dot_dot; - continue; - } else { /* We have something like ..bla or ... */ if (slash) { @@ -476,14 +455,6 @@ rspamd_http_normalize_path_inplace (gchar *path, guint len, gsize *nlen) p ++; break; - case st_replace_backslash: - /* - * Replace backslash and return to the previous state as it was - * a normal slash - */ - *(gchar *)p = '/'; - state = next_state; - break; } } |