Ensure non-null pointer is used in zello_ipc tests

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga 2021-11-16 02:56:03 +00:00 committed by Compute-Runtime-Automation
parent 712149abf5
commit 70a2d2f850
2 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,9 @@ static int recvmsg_fd(int socket) {
}
struct cmsghdr *controlHeader = CMSG_FIRSTHDR(&msgHeader);
if (CMSG_DATA(controlHeader) == nullptr) {
return -1;
}
memmove(&fd, CMSG_DATA(controlHeader), sizeof(int));
return fd;
}

View File

@ -69,6 +69,9 @@ static int recvmsg_fd(int socket) {
}
struct cmsghdr *controlHeader = CMSG_FIRSTHDR(&msgHeader);
if (CMSG_DATA(controlHeader) == nullptr) {
return -1;
}
memmove(&fd, CMSG_DATA(controlHeader), sizeof(int));
return fd;
}