diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-15 16:40:54 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-15 16:40:54 +0000 |
commit | 803a9062065ccf7a3dde90db5adb872e86d4be5b (patch) | |
tree | db7f65cab8aefd1250951ff21b10505ae1ae7b04 /src/libutil/map_helpers.c | |
parent | 7f62d657cea4e50d65dc6be53cb091774b540da3 (diff) | |
download | rspamd-803a9062065ccf7a3dde90db5adb872e86d4be5b.tar.gz rspamd-803a9062065ccf7a3dde90db5adb872e86d4be5b.zip |
[Project] Use own utf8 validation instead of glib
Diffstat (limited to 'src/libutil/map_helpers.c')
-rw-r--r-- | src/libutil/map_helpers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/map_helpers.c b/src/libutil/map_helpers.c index a9bd8d70e..d67e2fc4d 100644 --- a/src/libutil/map_helpers.c +++ b/src/libutil/map_helpers.c @@ -20,6 +20,7 @@ #include "radix.h" #include "rspamd.h" #include "cryptobox.h" +#include "contrib/fastutf8/fastutf8.h" #ifdef WITH_HYPERSCAN #include "hs.h" @@ -1189,7 +1190,7 @@ rspamd_match_regexp_map_single (struct rspamd_regexp_map_helper *map, } if (map->map_flags & RSPAMD_REGEXP_MAP_FLAG_UTF) { - if (g_utf8_validate (in, len, NULL)) { + if (rspamd_fast_utf8_validate (in, len) == 0) { validated = TRUE; } } @@ -1280,7 +1281,7 @@ rspamd_match_regexp_map_all (struct rspamd_regexp_map_helper *map, g_assert (in != NULL); if (map->map_flags & RSPAMD_REGEXP_MAP_FLAG_UTF) { - if (g_utf8_validate (in, len, NULL)) { + if (rspamd_fast_utf8_validate (in, len) == 0) { validated = TRUE; } } |