]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix disabling of virtual symbols
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Apr 2016 14:03:01 +0000 (15:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Apr 2016 14:03:01 +0000 (15:03 +0100)
src/libserver/symbols_cache.c

index 0ee9ed74c49d13c82b987585b5a1c1159fa55dfc..8b530cefee88fb1387e53b80da17e8b52d0967d7 100644 (file)
@@ -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);