aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-18 15:39:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-18 15:39:13 +0100
commit8e91417863ba0c1ce68e5f659f663c89608b482c (patch)
treec5c53207a6420ea0b3fdc5bd23a526bd9e5e079f
parent4baa3ea15a646dfce1e2d4edb0ae606d913ca6c2 (diff)
downloadrspamd-8e91417863ba0c1ce68e5f659f663c89608b482c.tar.gz
rspamd-8e91417863ba0c1ce68e5f659f663c89608b482c.zip
Add guard for fuzzy storage.
-rw-r--r--src/fuzzy_storage.c2
-rw-r--r--src/libserver/fuzzy_backend.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 96785fd75..c0ead6828 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -346,7 +346,7 @@ start_fuzzy (struct rspamd_worker *worker)
if ((ctx->backend = rspamd_fuzzy_backend_open (ctx->hashfile, &err)) == NULL) {
msg_err ("cannot open backend: %e", err);
g_error_free (err);
- exit (EXIT_FAILURE);
+ exit (EXIT_SUCCESS);
}
server_stat->fuzzy_hashes = rspamd_fuzzy_backend_count (ctx->backend);
diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c
index a5bf28c7c..aebd9fd48 100644
--- a/src/libserver/fuzzy_backend.c
+++ b/src/libserver/fuzzy_backend.c
@@ -391,6 +391,11 @@ rspamd_fuzzy_backend_open (const gchar *path, GError **err)
fallback_journal[] = "PRAGMA journal_mode=\"off\";";
int rc;
+ if (path == NULL) {
+ g_set_error (err, rspamd_fuzzy_backend_quark (),
+ ENOENT, "Path has not been specified");
+ return NULL;
+ }
/* First of all we check path for existence */
dir = g_path_get_dirname (path);
if (dir == NULL) {