aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-15 16:36:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-15 16:36:15 +0100
commit463aa1e6775557493a827c872296964e89902e0e (patch)
tree3ec3ba86b737fdfeadcd2ed4624e75bb3fdb6535 /src/libutil/regexp.c
parent2ac96851580eafff905d014c4cbc8c1c876c792f (diff)
downloadrspamd-463aa1e6775557493a827c872296964e89902e0e.tar.gz
rspamd-463aa1e6775557493a827c872296964e89902e0e.zip
Restore utf8 validation as it causes segfaults sometimes.
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r--src/libutil/regexp.c5
1 files 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
}