]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix issue if rspamd cannot create statfiles.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 8 Jul 2015 15:51:10 +0000 (16:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 8 Jul 2015 15:51:10 +0000 (16:51 +0100)
Issue: #331

src/libstat/stat_process.c

index 93692a6216fa4a2907db569ee389494763883eea..588beb9727e73fb09aa93720fcaae1d245d29736 100644 (file)
@@ -219,6 +219,15 @@ rspamd_stat_preprocess (struct rspamd_stat_ctx *st_ctx,
                        backend_runtime = bk->runtime (task, stcf, op != RSPAMD_CLASSIFY_OP,
                                        bk->ctx);
 
+                       if (backend_runtime == NULL && op != RSPAMD_CLASSIFY_OP) {
+                               /* Assume backend absence as fatal error */
+                               g_set_error (err, rspamd_stat_quark(), 500,
+                                       "cannot open backend for statfile %s", stcf->symbol);
+                               g_list_free (cl_runtimes);
+
+                               return NULL;
+                       }
+
                        st_runtime = rspamd_mempool_alloc0 (task->task_pool,
                                        sizeof (*st_runtime));
                        st_runtime->st = stcf;