aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-04 15:10:37 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-04 15:10:37 +0000
commit542dcdd1abde1e2cc52fa78fc28fc6ece00226b5 (patch)
treef564e4ce515ac679b4532cdef7f16c50f3676d88
parent4f93d610e2bb4f1895ac9f4720f7813d66a61fa3 (diff)
downloadrspamd-542dcdd1abde1e2cc52fa78fc28fc6ece00226b5.tar.gz
rspamd-542dcdd1abde1e2cc52fa78fc28fc6ece00226b5.zip
[Minor] Add guards for NaN values
-rw-r--r--src/libmime/filter.c3
-rw-r--r--src/libserver/symbols_cache.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index 303ef2e0f..cc34fcb0c 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -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;
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index 11eff0993..f7b410c28 100644
--- a/src/libserver/symbols_cache.c
+++ b/src/libserver/symbols_cache.c
@@ -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;
}