commit 50101ac: [Minor] Restrict `m` patterns in regexps

Vsevolod Stakhov vsevolod at rspamd.com
Sat Jul 30 19:56:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-07-30 20:52:08 +0100
URL: https://github.com/rspamd/rspamd/commit/50101aca1924f3d4ca4db4c34580e7fc560771b4 (HEAD -> master)

[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;
 


More information about the Commits mailing list