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/tcpdump | |
parent | 1730c3b24ef569d8a5d16c63d0ad63aaa745812c (diff) |
extra check for no message case; ok markus, deraadt, hshoexer, henning
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/privsep_fdpass.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/privsep_fdpass.c b/usr.sbin/tcpdump/privsep_fdpass.c index 22323275abb..bfb3d46e671 100644 --- a/usr.sbin/tcpdump/privsep_fdpass.c +++ b/usr.sbin/tcpdump/privsep_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep_fdpass.c,v 1.3 2004/06/18 19:34:58 henning Exp $ */ +/* $OpenBSD: privsep_fdpass.c,v 1.4 2004/08/13 02:51:48 djm Exp $ */ /* * Copyright (c) 2002 Matthieu Herrb @@ -90,6 +90,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); |