Check if there is cmsg at all.
MFC after: 3 days
This commit is contained in:
parent
d89862ac87
commit
4c13f63cba
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user