commit 5e2026f: [Fix] Fix setting of the subject pattern in config

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Feb 26 12:21:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-26 12:17:28 +0000
URL: https://github.com/rspamd/rspamd/commit/5e2026f579c0f58ad1d8d88d42485c800e93e7d7 (HEAD -> master)

[Fix] Fix setting of the subject pattern in config
Issue: #2765
Closes: #2765

---
 src/libserver/cfg_rcl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 9fa0af418..6c5343ccb 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -570,20 +570,20 @@ rspamd_rcl_actions_handler (rspamd_mempool_t *pool, const ucl_object_t *obj,
 		const gchar *key, gpointer ud,
 		struct rspamd_rcl_section *section, GError **err)
 {
-	gdouble action_score;
 	struct rspamd_config *cfg = ud;
-	gint action_value;
 	const ucl_object_t *cur;
 	ucl_object_iter_t it;
 
 	it = ucl_object_iterate_new (obj);
 
 	while ((cur = ucl_object_iterate_safe (it, true)) != NULL) {
-		if (ucl_object_type (cur) == UCL_NULL) {
+		gint type = ucl_object_type (cur);
+
+		if (type == UCL_NULL) {
 			rspamd_config_maybe_disable_action (cfg, ucl_object_key (cur),
 					ucl_object_get_priority (cur));
 		}
-		else {
+		else if (type == UCL_OBJECT || type == UCL_FLOAT || type == UCL_INT) {
 			if (!rspamd_config_set_action_score (cfg,
 					ucl_object_key (cur),
 					cur)) {


More information about the Commits mailing list