From: Vsevolod Stakhov Date: Fri, 26 Feb 2016 12:43:45 +0000 (+0000) Subject: Add more guards for mutable cache X-Git-Tag: 1.2.0~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3221163d1389de8b14f700b009ae01d87bc6497;p=thirdparty%2Frspamd.git Add more guards for mutable cache --- diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 59e0ede260..9e68f2a235 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -1135,6 +1135,15 @@ rspamd_symbols_cache_check_deps (struct rspamd_task *task, continue; } + if (dep->id >= (gint)checkpoint->version) { + /* + * This is dependency on some symbol that is currently + * not in this checkpoint. So we just pretend that the + * corresponding symbold does not exist + */ + continue; + } + if (!isset (checkpoint->processed_bits, dep->id * 2 + 1)) { if (!isset (checkpoint->processed_bits, dep->id * 2)) { /* Not started */ @@ -1302,6 +1311,11 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, /* We just go through the blocked symbols and check if they are ready */ for (i = 0; i < (gint)checkpoint->waitq->len; i ++) { item = g_ptr_array_index (checkpoint->waitq, i); + + if (item->id >= (gint)checkpoint->version) { + continue; + } + if (!isset (checkpoint->processed_bits, item->id * 2)) { if (!rspamd_symbols_cache_check_deps (task, cache, item, checkpoint)) {