From 23c75a3c766039f8fc5622c984edd33cafbae929 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 22 Nov 2016 15:17:16 +0000 Subject: [PATCH] [Fix] Fix hyperscan usage for non compatible platforms Issue: #1164 Reported by: @jirireischig --- src/libutil/map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libutil/map.c b/src/libutil/map.c index eaaea4ac0..07ce616c2 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -2278,6 +2278,12 @@ rspamd_re_map_finalize (struct rspamd_regexp_map *re_map) map = re_map->map; + if (!(map->cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) { + msg_info_map ("disable hyperscan for map %s, ssse3 instructons are not supported by CPU", + map->name); + return; + } + if (hs_populate_platform (&plt) != HS_SUCCESS) { msg_err_map ("cannot populate hyperscan platform"); return; -- 2.39.5