From ef7e7cbfe393e392eccfc025c7ac00ec0ed0c020 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 27 Jan 2017 15:18:54 +0000 Subject: [PATCH] [Fix] Fix issues with empty updates --- src/libserver/fuzzy_backend.c | 2 +- src/libserver/fuzzy_backend_redis.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.5