svn commit: r237931 - head/sbin/hastd

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Jul 1 16:26:08 UTC 2012


Author: pjd
Date: Sun Jul  1 16:26:07 2012
New Revision: 237931
URL: http://svn.freebsd.org/changeset/base/237931

Log:
  Check if there is cmsg at all.
  
  MFC after:	3 days

Modified:
  head/sbin/hastd/proto_common.c

Modified: head/sbin/hastd/proto_common.c
==============================================================================
--- head/sbin/hastd/proto_common.c	Sun Jul  1 15:43:52 2012	(r237930)
+++ head/sbin/hastd/proto_common.c	Sun Jul  1 16:26:07 2012	(r237931)
@@ -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);
 	}


More information about the svn-src-head mailing list