summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-09 17:28:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-09 17:28:32 +0000
commit3223f408df78031f651c76109b48a5bc8fbd93dd (patch)
tree362fbc3ea274ff806f47880b00f007913eae5b47
parent8dcfc4994b8e370867033337c1a231d4fa3bd111 (diff)
downloadrspamd-3223f408df78031f651c76109b48a5bc8fbd93dd.tar.gz
rspamd-3223f408df78031f651c76109b48a5bc8fbd93dd.zip
Fix race condition.
This race condition could occur if a message has too high spam score and the planner decides to stop checking. However, already registered events pending were not checked, which caused use-after-free for a task object.
-rw-r--r--src/libmime/filter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index 99e888730..89bbfad10 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -381,7 +381,9 @@ rspamd_process_filters (struct rspamd_task *task)
if (!task->pass_all_filters &&
metric->actions[METRIC_ACTION_REJECT].score > 0 &&
check_metric_is_spam (task, metric)) {
- task->state = WRITE_REPLY;
+ msg_info ("<%s> has already scored more than %.2f, so do not "
+ "plan any more checks", task->message_id,
+ metric->actions[METRIC_ACTION_REJECT].score);
return 1;
}
cur = g_list_next (cur);