From 50101aca1924f3d4ca4db4c34580e7fc560771b4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 30 Jul 2022 20:52:08 +0100 Subject: [PATCH] [Minor] Restrict `m` patterns in regexps Issue: #4221 --- src/libutil/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index cd34a5998..534187f37 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -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; -- 2.39.5