diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2016-06-20 20:26:05 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2016-06-20 20:26:05 +0000 |
commit | 5130fd8a60c9348d46dd1db0f74996464a3f2fed (patch) | |
tree | c32959c1c0040bc4898eb1431b3452aea3f357ba | |
parent | 88a9ff480b63726e95ee31b8de5fb6b466c6871c (diff) |
with new fork+reexec, in case of failure in init of any child process
causing it to exit, we could end up with a NULL deref in parent.
free commit offered by eric@, ok gilles@
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index a3d3eeea656..b510c295346 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.278 2016/06/07 06:52:49 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.279 2016/06/20 20:26:04 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -161,6 +161,9 @@ parent_imsg(struct mproc *p, struct imsg *imsg) void *i; int fd, n, v, ret; + if (imsg == NULL) + exit(1); + if (p->proc == PROC_LKA) { switch (imsg->hdr.type) { case IMSG_LKA_OPEN_FORWARD: |