diff options
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/cfg_rcl.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index a01f42ea6..08c7c7868 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -38,6 +38,8 @@ #include <glob.h> #endif +#include <math.h> + struct rspamd_rcl_default_handler_data { struct rspamd_rcl_struct_parser pd; gchar *key; @@ -450,16 +452,22 @@ rspamd_rcl_actions_handler (rspamd_mempool_t *pool, const ucl_object_t *obj, continue; } else { - if (!ucl_object_todouble_safe (cur, &action_score)) { - g_set_error (err, - CFG_RCL_ERROR, - EINVAL, - "invalid action definition: '%s'", - ucl_object_key (cur)); - ucl_object_iterate_free (it); + if (ucl_object_type (cur) == UCL_NULL) { + action_score = NAN; + } + else { + if (!ucl_object_todouble_safe (cur, &action_score)) { + g_set_error (err, + CFG_RCL_ERROR, + EINVAL, + "invalid action definition: '%s'", + ucl_object_key (cur)); + ucl_object_iterate_free (it); - return FALSE; + return FALSE; + } } + rspamd_config_set_action_score (cfg, ucl_object_key (cur), action_score, |