]> source.dussan.org Git - rspamd.git/commitdiff
Revert "[Fix] Escape utf in regexp to dodge ragel/hyperscan issue"
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 5 Jun 2019 09:45:27 +0000 (10:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 5 Jun 2019 09:45:27 +0000 (10:45 +0100)
This reverts commit e658c7fcb5d275f144954b9cea1c34fadfa81902.

src/libmime/mime_expressions.c
src/libutil/str_util.c
src/libutil/str_util.h

index 89111743bf02c08120e6780a8bf05cc3d52e1628..7a0c27f1bc96541010a9cf1d97b01a3f34b270b6 100644 (file)
@@ -491,14 +491,9 @@ rspamd_mime_expr_parse_regexp_atom (rspamd_mempool_t * pool, const gchar *line,
        dend = result->regexp_text + (end - start);
        *dend = '\0';
 
-       gsize esc_len;
-       gchar *escaped = rspamd_str_regexp_escape (dbegin, dend - dbegin, &esc_len,
-                       RSPAMD_REGEXP_ESCAPE_UTF);
-
-       result->regexp = rspamd_regexp_new (escaped, re_flags->str,
+       result->regexp = rspamd_regexp_new (dbegin, re_flags->str,
                        &err);
 
-       g_free (escaped);
        g_string_free (re_flags, TRUE);
 
        if (result->regexp == NULL || err != NULL) {
index 0c8ff71443e810014f7efbf5fd442210356c5949..290110b2bd9539e8751e4304deae62eb78c1d778 100644 (file)
@@ -2591,7 +2591,7 @@ out:
 
 gchar *
 rspamd_str_regexp_escape (const gchar *pattern, gsize slen,
-                                                 gsize *dst_len, enum rspamd_regexp_escape_flags flags)
+               gsize *dst_len, enum rspamd_regexp_escape_flags flags)
 {
        const gchar *p, *end = pattern + slen;
        gchar *res, *d, t, *tmp_utf = NULL, *dend;
index 4a5a8a63a9c308a5053762e3074d622c28464cf5..8e8898a32bc68457830303d227a540cab24dee53 100644 (file)
@@ -466,7 +466,7 @@ enum rspamd_regexp_escape_flags {
  */
 gchar *
 rspamd_str_regexp_escape (const gchar *pattern, gsize slen,
-                                                 gsize *dst_len, enum rspamd_regexp_escape_flags flags);
+               gsize *dst_len, enum rspamd_regexp_escape_flags flags);
 
 /**
  * Returns copy of src (zero terminated) where all unicode is made valid or replaced