aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-25 17:01:00 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-25 17:01:00 +0000
commit4184776a1744bfa1e73eac80e8126573d8aae0f0 (patch)
tree918cbd83df5a16eb4d88ce0b493dc71a171b67e6 /src/libutil
parenta8d97d481aea7fc2acc88055c82431d5e736c817 (diff)
downloadrspamd-4184776a1744bfa1e73eac80e8126573d8aae0f0.tar.gz
rspamd-4184776a1744bfa1e73eac80e8126573d8aae0f0.zip
[Fix] Fix tld compositon rules
Issue: #3248, #3268
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/multipattern.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 6eec009b3..f243c1d8a 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -108,7 +108,6 @@ rspamd_multipattern_escape_tld_hyperscan (const gchar *pattern, gsize slen,
*/
if (pattern[0] == '*') {
- len = slen + 4;
p = strchr (pattern, '.');
if (p == NULL) {
@@ -119,12 +118,13 @@ rspamd_multipattern_escape_tld_hyperscan (const gchar *pattern, gsize slen,
p ++;
}
- prefix = ".*.";
+ prefix = "\\.";
+ len = slen + strlen (prefix);
}
else {
- len = slen + 1;
- prefix = ".";
+ prefix = "\\.";
p = pattern;
+ len = slen + strlen (prefix);
}
res = g_malloc (len + 1);
@@ -208,7 +208,7 @@ rspamd_multipattern_pattern_filter (const gchar *pattern, gsize len,
tmp = rspamd_multipattern_escape_tld_hyperscan (pattern, len, &tlen);
ret = rspamd_str_regexp_escape (tmp, tlen, dst_len,
- gl_flags|RSPAMD_REGEXP_ESCAPE_GLOB);
+ gl_flags|RSPAMD_REGEXP_ESCAPE_RE);
g_free (tmp);
}
else if (flags & RSPAMD_MULTIPATTERN_RE) {