diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-17 10:00:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-17 10:00:32 +0100 |
commit | 76e216dd05fdb02001f0107b54cff92a694a1e16 (patch) | |
tree | e2afcf7730aadb7eb8c0c139357a49c59c202e9b | |
parent | b41417742ec343a9e805b70f761eb51cc46c818d (diff) | |
download | rspamd-76e216dd05fdb02001f0107b54cff92a694a1e16.tar.gz rspamd-76e216dd05fdb02001f0107b54cff92a694a1e16.zip |
[Minor] Fix regexp parsing bug
-rw-r--r-- | src/libutil/regexp.c | 4 |
1 files 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; |