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 /usr.sbin/syslogd/privsep_fdpass.c | |
parent | 1730c3b24ef569d8a5d16c63d0ad63aaa745812c (diff) |
extra check for no message case; ok markus, deraadt, hshoexer, henning
Diffstat (limited to 'usr.sbin/syslogd/privsep_fdpass.c')
-rw-r--r-- | usr.sbin/syslogd/privsep_fdpass.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/syslogd/privsep_fdpass.c b/usr.sbin/syslogd/privsep_fdpass.c index 6638055c37c..630cc4ce268 100644 --- a/usr.sbin/syslogd/privsep_fdpass.c +++ b/usr.sbin/syslogd/privsep_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep_fdpass.c,v 1.2 2004/07/03 23:40:44 djm Exp $ */ +/* $OpenBSD: privsep_fdpass.c,v 1.3 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); |