From 463aa1e6775557493a827c872296964e89902e0e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 May 2015 16:36:15 +0100 Subject: [PATCH] Restore utf8 validation as it causes segfaults sometimes. --- src/libutil/regexp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index 977bb0268..15d83dd44 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -382,11 +382,12 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len, #endif } else { - match_flags |= PCRE_NO_UTF8_CHECK; r = re->re; ext = re->extra; #if defined(HAVE_PCRE_JIT) && defined(HAVE_PCRE_JIT_FAST) - st = re->jstack; + if (g_utf8_validate (mt, remain, NULL)) { + st = re->jstack; + } #endif } -- 2.39.5