summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtp_session.c
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2016-10-03 19:36:12 +0000
committerEric Faurot <eric@cvs.openbsd.org>2016-10-03 19:36:12 +0000
commitd3f5655b3738ae66a220dce27082890350f0f1d9 (patch)
tree13c1ad34d4c62e5d83d980607d41577086c43e08 /usr.sbin/smtpd/smtp_session.c
parent8f4a3c2b27bbc14170d03580eed8edc02a70c845 (diff)
fix smtp session logic bug that can lead to a server crash.
Diffstat (limited to 'usr.sbin/smtpd/smtp_session.c')
-rw-r--r--usr.sbin/smtpd/smtp_session.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 6b1102c54c0..75ca65e3110 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.286 2016/09/03 22:59:06 giovanni Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.287 2016/10/03 19:36:11 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -1156,6 +1156,7 @@ smtp_filter_response(uint64_t id, int query, int status, uint32_t code,
line = line ? line : "Message rejected";
smtp_reply(s, "%d %s", code, line);
smtp_enter_state(s, STATE_HELO);
+ s->phase = PHASE_SETUP;
io_reload(&s->io);
return;
}
@@ -1552,6 +1553,7 @@ smtp_data_io_done(struct smtp_session *s)
smtp_reply(s, "421 Internal server error");
smtp_tx_free(s->tx);
smtp_enter_state(s, STATE_HELO);
+ s->phase = PHASE_SETUP;
io_reload(&s->io);
}
else {