]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Restrict `m` patterns in regexps
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 30 Jul 2022 19:52:08 +0000 (20:52 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 30 Jul 2022 19:52:08 +0000 (20:52 +0100)
Issue: #4221

src/libutil/regexp.c

index cd34a5998759ff0d17d9020ed922c89d7102bd1c..534187f37d7dfcbd75c510a6edb6096c1dc39f07 100644 (file)
@@ -336,7 +336,7 @@ rspamd_regexp_new_len (const gchar *pattern, gsize len, const gchar *flags,
                if (*start == '/') {
                        sep = '/';
                }
-               else if (*start == 'm' && !g_ascii_isalnum(start[1])) {
+               else if (*start == 'm' && start[1] != '\\' && g_ascii_ispunct(start[1])) {
                        start ++;
                        sep = *start;