From 67de370681b5d2590609b7509f3899c99db89a84 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 19 Apr 2016 15:03:01 +0100 Subject: [PATCH] [Fix] Fix disabling of virtual symbols --- src/libserver/symbols_cache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 0ee9ed74c..8b530cefe 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -1724,6 +1724,7 @@ rspamd_symbols_cache_disable_symbol (struct rspamd_task *task, { struct cache_savepoint *checkpoint; struct cache_item *item; + gint id; if (task->checkpoint == NULL) { checkpoint = rspamd_symbols_cache_make_checkpoint (task, cache); @@ -1733,10 +1734,11 @@ rspamd_symbols_cache_disable_symbol (struct rspamd_task *task, checkpoint = task->checkpoint; } - item = g_hash_table_lookup (cache->items_by_symbol, symbol); + id = rspamd_symbols_cache_find_symbol_parent (cache, symbol); - if (item != NULL) { + if (id > 0) { /* Set executed and finished flags */ + item = g_ptr_array_index (cache->items_by_id, id); setbit (checkpoint->processed_bits, item->id * 2); setbit (checkpoint->processed_bits, item->id * 2 + 1); -- 2.39.5