]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix slash + dot in urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Apr 2018 11:28:18 +0000 (12:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Apr 2018 11:28:18 +0000 (12:28 +0100)
Issue: #2181

src/libutil/http.c

index c6b77ee1591cf99d6eeddaaaeaa162d18748eed8..ade3160cd1017a2d886e8fc78a846bcf449c7b77 100644 (file)
@@ -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;