aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-05 10:45:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-05 10:45:27 +0100
commita15eaba20a77b536766871ce1d42b6dc11f8d6e3 (patch)
treee65dc6542ddf5552b0a609af10505545b9b387da
parent0cb382f10a1480e4c48e0912f9740a65494cb075 (diff)
downloadrspamd-a15eaba20a77b536766871ce1d42b6dc11f8d6e3.tar.gz
rspamd-a15eaba20a77b536766871ce1d42b6dc11f8d6e3.zip
Revert "[Fix] Escape utf in regexp to dodge ragel/hyperscan issue"
This reverts commit e658c7fcb5d275f144954b9cea1c34fadfa81902.
-rw-r--r--src/libmime/mime_expressions.c7
-rw-r--r--src/libutil/str_util.c2
-rw-r--r--src/libutil/str_util.h2
3 files changed, 3 insertions, 8 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index 89111743b..7a0c27f1b 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -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) {
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 0c8ff7144..290110b2b 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -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;
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index 4a5a8a63a..8e8898a32 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -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