]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add guards for NaN values
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Mar 2016 15:10:37 +0000 (15:10 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Mar 2016 15:10:37 +0000 (15:10 +0000)
src/libmime/filter.c
src/libserver/symbols_cache.c

index 303ef2e0fd5a82dbc48f9c3c189d90987c9c0b99..cc34fcb0ce8146fc4df2bfd9e1d0a2b0f5eb150c 100644 (file)
@@ -383,9 +383,10 @@ rspamd_check_action_metric (struct rspamd_task *task,
                action = &metric->actions[i];
                sc = get_specific_action_score (task, ms, action);
 
-               if (sc < 0) {
+               if (isnan (sc)) {
                        continue;
                }
+
                if (score >= sc && sc > max_score) {
                        selected_action = action;
                        max_score = sc;
index 11eff0993c14bcb911590a544b760d329b7bcb54..f7b410c287ccfa97da7ef9530833032d79d9803f 100644 (file)
@@ -1030,7 +1030,7 @@ rspamd_symbols_cache_metric_limit (struct rspamd_task *task,
                                        ms = metric->actions[METRIC_ACTION_REJECT].score;
                                }
 
-                               if (cp->lim < ms) {
+                               if (!isnan (ms) && cp->lim < ms) {
                                        cp->rs = res;
                                        cp->lim = ms;
                                }