diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-26 12:43:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-26 12:43:45 +0000 |
commit | d3221163d1389de8b14f700b009ae01d87bc6497 (patch) | |
tree | 69be4fdfbd05d95778d22124f19a5f9409e16aa7 | |
parent | 0ab3629d70323576c59c160c9658d3a70c80df40 (diff) | |
download | rspamd-d3221163d1389de8b14f700b009ae01d87bc6497.tar.gz rspamd-d3221163d1389de8b14f700b009ae01d87bc6497.zip |
Add more guards for mutable cache
-rw-r--r-- | src/libserver/symbols_cache.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 59e0ede26..9e68f2a23 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)) { |