summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/proto_common.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-07-01 16:26:07 +0000
committerpjd <pjd@FreeBSD.org>2012-07-01 16:26:07 +0000
commitc34c233e835da97d5c970b8700571fd2ddfd0e52 (patch)
tree07c781c4e669c5a1efa6a6a42ee602ffba51405a /sbin/hastd/proto_common.c
parent1a62bb322429c1e61662250887fdaf2659cfa436 (diff)
downloadFreeBSD-src-c34c233e835da97d5c970b8700571fd2ddfd0e52.zip
FreeBSD-src-c34c233e835da97d5c970b8700571fd2ddfd0e52.tar.gz
Check if there is cmsg at all.
MFC after: 3 days
Diffstat (limited to 'sbin/hastd/proto_common.c')
-rw-r--r--sbin/hastd/proto_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/hastd/proto_common.c b/sbin/hastd/proto_common.c
index 59b1e39..843366b 100644
--- a/sbin/hastd/proto_common.c
+++ b/sbin/hastd/proto_common.c
@@ -181,7 +181,7 @@ proto_descriptor_recv(int sock, int *fdp)
return (errno);
cmsg = CMSG_FIRSTHDR(&msg);
- if (cmsg->cmsg_level != SOL_SOCKET ||
+ if (cmsg == NULL || cmsg->cmsg_level != SOL_SOCKET ||
cmsg->cmsg_type != SCM_RIGHTS) {
return (EINVAL);
}
OpenPOWER on IntegriCloud