diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-08-13 02:51:49 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-08-13 02:51:49 +0000 |
commit | d21b44b6716776eade78a52e6068d52b82bdd58e (patch) | |
tree | b5c4e88f74c1d814fac5d827ca0bb103db5b146a /sbin/pflogd | |
parent | 1730c3b24ef569d8a5d16c63d0ad63aaa745812c (diff) |
extra check for no message case; ok markus, deraadt, hshoexer, henning
Diffstat (limited to 'sbin/pflogd')
-rw-r--r-- | sbin/pflogd/privsep_fdpass.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/pflogd/privsep_fdpass.c b/sbin/pflogd/privsep_fdpass.c index 166b6930b3b..50afdfc2859 100644 --- a/sbin/pflogd/privsep_fdpass.c +++ b/sbin/pflogd/privsep_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep_fdpass.c,v 1.1 2003/10/22 18:51:55 canacar Exp $ */ +/* $OpenBSD: privsep_fdpass.c,v 1.2 2004/08/13 02:51:48 djm Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -108,6 +108,10 @@ receive_fd(int sock) __func__, (long)n); if (result == 0) { cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg == NULL) { + warnx("%s: no message header", __func__); + return -1; + } if (cmsg->cmsg_type != SCM_RIGHTS) warnx("%s: expected type %d got %d", __func__, SCM_RIGHTS, cmsg->cmsg_type); |