]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix hyperscan usage for non compatible platforms
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Nov 2016 15:17:16 +0000 (15:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Nov 2016 15:17:56 +0000 (15:17 +0000)
Issue: #1164
Reported by: @jirireischig

src/libutil/map.c

index eaaea4ac05623b974ffc2aeb9ef510a18c45e7e0..07ce616c27db292c992bd50014949c12526c5df6 100644 (file)
@@ -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;