]> source.dussan.org Git - rspamd.git/commitdiff
Restore utf8 validation as it causes segfaults sometimes.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 May 2015 15:36:15 +0000 (16:36 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 May 2015 15:36:15 +0000 (16:36 +0100)
src/libutil/regexp.c

index 977bb026854e448a056027ab256df59d728555be..15d83dd44e75406ede0f5c62593ce11a09835c49 100644 (file)
@@ -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
        }