summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2019-09-10 19:30:13 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2019-09-10 19:30:13 +0000
commit715070735f81e86145b509f70ee0fae8843feab7 (patch)
tree5732201465ff9fd6c0cbb312086933ccdbc21139 /usr.sbin/smtpd
parent927dee73c4fec1854b7b252051d7587dcb8ed025 (diff)
do not use tree_xget() between filters resume as a session may legitimately
go away due to a disconnection before a filter responds. diff from martijn@, committing on his behalf
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/lka_filter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/lka_filter.c b/usr.sbin/smtpd/lka_filter.c
index bf7c721a501..4c5ee665698 100644
--- a/usr.sbin/smtpd/lka_filter.c
+++ b/usr.sbin/smtpd/lka_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka_filter.c,v 1.48 2019/09/06 08:23:56 martijn Exp $ */
+/* $OpenBSD: lka_filter.c,v 1.49 2019/09/10 19:30:12 gilles Exp $ */
/*
* Copyright (c) 2018 Gilles Chehade <gilles@poolp.org>
@@ -460,7 +460,10 @@ lka_filter_process_response(const char *name, const char *line)
response = ep+1;
- fs = tree_xget(&sessions, reqid);
+ /* session can legitimately disappear on a resume */
+ if ((fs = tree_xget(&sessions, reqid)) == NULL)
+ return;
+
if (strcmp(kind, "filter-dataline") == 0) {
if (fs->phase != FILTER_DATA_LINE)
fatalx("filter-dataline out of dataline phase");