commit 8d68b5d: [Minor] Fix utf8 multipatterns without hyperscan

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Aug 4 14:35:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-08-04 10:33:51 +0100
URL: https://github.com/rspamd/rspamd/commit/8d68b5d3ae90a9e34c83017f2a8248f093e4aa8a

[Minor] Fix utf8 multipatterns without hyperscan

---
 src/libutil/multipattern.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 8ddd9af38..2842b1d59 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -535,10 +535,14 @@ rspamd_multipattern_compile (struct rspamd_multipattern *mp, GError **err)
 
 			for (guint i = 0; i < mp->cnt; i ++) {
 				const ac_trie_pat_t *pat;
+				const gchar *pat_flags = NULL;
 
-				pat = &g_array_index (mp->pats, ac_trie_pat_t, i);
+				if (mp->flags & RSPAMD_MULTIPATTERN_UTF8) {
+					pat_flags = "u";
+				}
 
-				re = rspamd_regexp_new (pat->ptr, NULL, err);
+				pat = &g_array_index (mp->pats, ac_trie_pat_t, i);
+				re = rspamd_regexp_new (pat->ptr, pat_flags, err);
 
 				if (re == NULL) {
 					return FALSE;


More information about the Commits mailing list