]> source.dussan.org Git - rspamd.git/commitdiff
Add more guards for mutable cache
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 26 Feb 2016 12:43:45 +0000 (12:43 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 26 Feb 2016 12:43:45 +0000 (12:43 +0000)
src/libserver/symbols_cache.c

index 59e0ede260f7d040dd19079b6172807468ad36bc..9e68f2a235dbc3265560f00291a3e51617a10126 100644 (file)
@@ -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)) {