summaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-31 13:35:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-31 13:35:07 +0100
commit8a17010c05fefde3b5775586fa9b373549083cd3 (patch)
treeb7caa9ed86737627ec6aa8d640980d24472e5452 /src/libutil/regexp.c
parentd0543dbf5628edf422859d9b230152acc1d7291f (diff)
downloadrspamd-8a17010c05fefde3b5775586fa9b373549083cd3.tar.gz
rspamd-8a17010c05fefde3b5775586fa9b373549083cd3.zip
Add some guards to protect pcre_jit fast path.
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r--src/libutil/regexp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index bf1a1762d..a83660e8e 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -347,6 +347,10 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
#ifdef HAVE_PCRE_JIT
# if (PCRE_MAJOR == 8 && PCRE_MINOR >= 32)
/* XXX: flags seems to be broken with jit fast path */
+ g_assert (remain > 0);
+ g_assert (mt != NULL);
+ g_assert (st != NULL);
+
rc = pcre_jit_exec (r, ext, mt, remain, 0, 0, ovec,
G_N_ELEMENTS (ovec), st);
# else