aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-27 15:18:54 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-27 15:18:54 +0000
commitef7e7cbfe393e392eccfc025c7ac00ec0ed0c020 (patch)
treea5184e66e78ff59ee95abe02e64f98f0d053bde0 /src
parent63566714e3fe1ab35f2caf6c76e2f61af49d56c3 (diff)
downloadrspamd-ef7e7cbfe393e392eccfc025c7ac00ec0ed0c020.tar.gz
rspamd-ef7e7cbfe393e392eccfc025c7ac00ec0ed0c020.zip
[Fix] Fix issues with empty updates
Diffstat (limited to 'src')
-rw-r--r--src/libserver/fuzzy_backend.c2
-rw-r--r--src/libserver/fuzzy_backend_redis.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c
index 5ab673959..f9b46c167 100644
--- a/src/libserver/fuzzy_backend.c
+++ b/src/libserver/fuzzy_backend.c
@@ -332,7 +332,7 @@ rspamd_fuzzy_backend_process_updates (struct rspamd_fuzzy_backend *bk,
g_assert (bk != NULL);
g_assert (updates != NULL);
- if (g_queue_get_length (updates) > 0) {
+ if (updates) {
bk->subr->update (bk, updates, src, cb, ud, bk->subr_ud);
}
else if (cb) {
diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c
index f6ca12130..9a6648d4d 100644
--- a/src/libserver/fuzzy_backend_redis.c
+++ b/src/libserver/fuzzy_backend_redis.c
@@ -1095,6 +1095,9 @@ rspamd_fuzzy_update_append_command (struct rspamd_fuzzy_backend *bk,
return FALSE;
}
}
+ else {
+ g_assert_not_reached ();
+ }
if (io_cmd->is_shingle) {
if (cmd->cmd == FUZZY_WRITE) {
@@ -1165,6 +1168,9 @@ rspamd_fuzzy_update_append_command (struct rspamd_fuzzy_backend *bk,
}
}
}
+ else {
+ g_assert_not_reached ();
+ }
}
*shift = cur_shift;