From e409d221019f1127537d449273b7bf4c72085c55 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 8 Apr 2017 09:11:16 +0100 Subject: [PATCH] [Minor] Remove minor warnings --- src/libmime/filter.c | 2 ++ src/plugins/fuzzy_check.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libmime/filter.c b/src/libmime/filter.c index d6c550824..4a1b8bcbc 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -382,6 +382,8 @@ rspamd_check_action_metric (struct rspamd_task *task, struct rspamd_metric_resul } } else { + sc = NAN; + for (i = task->pre_result.action; i < METRIC_ACTION_MAX; i ++) { selected_action = &mres->metric->actions[i]; sc = mres->actions_limits[i]; diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 317bb7dd4..bc8f326a7 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1130,7 +1130,7 @@ fuzzy_cmd_stat (struct fuzzy_rule *rule, rspamd_mempool_t *pool) { struct rspamd_fuzzy_cmd *cmd; - struct rspamd_fuzzy_encrypted_cmd *enccmd; + struct rspamd_fuzzy_encrypted_cmd *enccmd = NULL; struct fuzzy_cmd_io *io; if (rule->peer_key) { @@ -1151,7 +1151,7 @@ fuzzy_cmd_stat (struct fuzzy_rule *rule, io->tag = cmd->tag; memcpy (&io->cmd, cmd, sizeof (io->cmd)); - if (rule->peer_key) { + if (rule->peer_key && enccmd) { fuzzy_encrypt_cmd (rule, &enccmd->hdr, (guchar *)cmd, sizeof (*cmd)); io->io.iov_base = enccmd; io->io.iov_len = sizeof (*enccmd); @@ -1173,7 +1173,7 @@ fuzzy_cmd_hash (struct fuzzy_rule *rule, rspamd_mempool_t *pool) { struct rspamd_fuzzy_cmd *cmd; - struct rspamd_fuzzy_encrypted_cmd *enccmd; + struct rspamd_fuzzy_encrypted_cmd *enccmd = NULL; struct fuzzy_cmd_io *io; if (rule->peer_key) { @@ -1208,7 +1208,7 @@ fuzzy_cmd_hash (struct fuzzy_rule *rule, memcpy (&io->cmd, cmd, sizeof (io->cmd)); - if (rule->peer_key) { + if (rule->peer_key && enccmd) { fuzzy_encrypt_cmd (rule, &enccmd->hdr, (guchar *)cmd, sizeof (*cmd)); io->io.iov_base = enccmd; io->io.iov_len = sizeof (*enccmd); -- 2.39.5