commit a15eaba: Revert "[Fix] Escape utf in regexp to dodge ragel/hyperscan issue"

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jun 5 10:42:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-05 10:45:27 +0100
URL: https://github.com/rspamd/rspamd/commit/a15eaba20a77b536766871ce1d42b6dc11f8d6e3

Revert "[Fix] Escape utf in regexp to dodge ragel/hyperscan issue"
This reverts commit e658c7fcb5d275f144954b9cea1c34fadfa81902.

---
 src/libmime/mime_expressions.c | 7 +------
 src/libutil/str_util.c         | 2 +-
 src/libutil/str_util.h         | 2 +-
 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


More information about the Commits mailing list