typedef guchar regexp_id_t[rspamd_cryptobox_HASHBYTES];
+#define DISABLE_JIT_FAST 1
+
struct rspamd_regexp_s {
gdouble exec_time;
gchar *pattern;
{
pcre *r;
pcre_extra *ext;
-#if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST)
+#if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST) && !defined(DISABLE_JIT_FAST)
pcre_jit_stack *st = NULL;
#endif
const gchar *mt;
if ((re->flags & RSPAMD_REGEXP_FLAG_RAW) || raw) {
r = re->raw_re;
ext = re->raw_extra;
-#if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST)
+#if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST) && !defined(DISABLE_JIT_FAST)
st = re->raw_jstack;
#endif
}
else {
r = re->re;
ext = re->extra;
-#if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST)
+#if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST) && !defined(DISABLE_JIT_FAST)
if (g_utf8_validate (mt, remain, NULL)) {
st = re->jstack;
}
+ else {
+ msg_err ("bad utf8 input for JIT re");
+ return FALSE;
+ }
#endif
}
if (!(re->flags & RSPAMD_REGEXP_FLAG_NOOPT)) {
#ifdef HAVE_PCRE_JIT
-# ifdef HAVE_PCRE_JIT_FAST
+# if defined(HAVE_PCRE_JIT_FAST) && !defined(DISABLE_JIT_FAST)
/* XXX: flags seems to be broken with jit fast path */
g_assert (remain > 0);
g_assert (mt != NULL);