]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Do not allow garbadge when checking url domain
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Sep 2017 18:24:55 +0000 (19:24 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Sep 2017 18:24:55 +0000 (19:24 +0100)
src/libserver/url.c

index 824c0dff88804e35e773a95d294434ea8ae6338c..f7a73ac5a7f3f992bc828e3e5f68202d91ba8544 100644 (file)
@@ -965,9 +965,17 @@ rspamd_web_parse (struct http_parser_url *u, const gchar *str, gsize len,
 
                                                        p = p + i;
                                                }
-                                               else {
+                                               else if (is_urlsafe (*p)) {
                                                        p ++;
                                                }
+                                               else {
+                                                       if (strict) {
+                                                               goto out;
+                                                       }
+                                                       else {
+                                                               goto set;
+                                                       }
+                                               }
                                        }
                                        else {
                                                p++;