aboutsummaryrefslogtreecommitdiffstats
path: root/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2016-05-09 18:48:01 +0200
committerGilles Chehade <gilles@poolp.org>2016-05-09 18:49:57 +0200
commitcafb856470d3f1f8385f312405cc9e0f62ea889c (patch)
treeb120edfdaab8ea09a4053ef8c0ae110e3353448e /smtpd
parentplug memory and descriptor leak (diff)
downloadOpenSMTPD-cafb856470d3f1f8385f312405cc9e0f62ea889c.tar.xz
OpenSMTPD-cafb856470d3f1f8385f312405cc9e0f62ea889c.zip
do not forget to clear filter data state in error code path, this
can lead to a fatal() being triggered if bad sequence of events leads to the session being reused after it hit that codepath.
Diffstat (limited to 'smtpd')
-rw-r--r--smtpd/smtp_session.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/smtpd/smtp_session.c b/smtpd/smtp_session.c
index 78552b90..85c1d206 100644
--- a/smtpd/smtp_session.c
+++ b/smtpd/smtp_session.c
@@ -1144,6 +1144,7 @@ smtp_filter_response(uint64_t id, int query, int status, uint32_t code,
case QUERY_EOM:
if (status != FILTER_OK) {
+ tree_pop(&wait_filter_data, s->id);
smtp_filter_rollback(s);
code = code ? code : 530;
line = line ? line : "Message rejected";
@@ -1450,6 +1451,8 @@ smtp_data_io_done(struct smtp_session *s)
if (s->msgflags & MF_ERROR) {
+ tree_pop(&wait_filter_data, s->id);
+
smtp_filter_rollback(s);
smtp_queue_rollback(s);