]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix multipattern escaping for TLDs
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Feb 2019 21:00:18 +0000 (21:00 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 Feb 2019 21:00:18 +0000 (21:00 +0000)
src/libutil/multipattern.c

index c1d0d6499b0d6f15be821b023ef38e74cdd0fada..2681705124ab29409a643a19027240c5a0f19b5b 100644 (file)
@@ -99,8 +99,8 @@ rspamd_multipattern_escape_tld_hyperscan (const gchar *pattern, gsize slen,
 
        /*
         * We understand the following cases
-        * 1) blah -> \\.blah
-        * 2) *.blah -> \\..*\\.blah
+        * 1) blah -> .blah
+        * 2) *.blah -> ..*\\.blah
         * 3) ???
         */
 
@@ -116,10 +116,10 @@ rspamd_multipattern_escape_tld_hyperscan (const gchar *pattern, gsize slen,
                        p ++;
                }
 
-               prefix = ".*";
+               prefix = ".*.";
        }
        else {
-               len = slen + 2;
+               len = slen + 1;
                prefix = ".";
                p = pattern;
        }