From: Vsevolod Stakhov Date: Sat, 30 Jul 2022 19:52:08 +0000 (+0100) Subject: [Minor] Restrict `m` patterns in regexps X-Git-Tag: 3.3~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50101aca1924f3d4ca4db4c34580e7fc560771b4;p=thirdparty%2Frspamd.git [Minor] Restrict `m` patterns in regexps Issue: #4221 --- diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index cd34a59987..534187f37d 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;