mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
Check if there is cmsg at all.
MFC after: 3 days
This commit is contained in:
parent
d89862ac87
commit
4c13f63cba
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=237931
@ -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