From 76e216dd05fdb02001f0107b54cff92a694a1e16 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 17 Jul 2021 10:00:32 +0100 Subject: [Minor] Fix regexp parsing bug --- src/libutil/regexp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index e9934083d..700b595c1 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -331,12 +331,12 @@ rspamd_regexp_new_len (const gchar *pattern, gsize len, const gchar *flags, return NULL; } - if (flags == NULL && start < end) { + if (flags == NULL && start + 1 < end) { /* We need to parse pattern and detect flags set */ if (*start == '/') { sep = '/'; } - else if (*start == 'm') { + else if (*start == 'm' && !g_ascii_isalnum(start[1])) { start ++; sep = *start; -- cgit v1.2.3