Change-Id: I910508371c5c728b00aec5c749fb11c8526a1bfb
assert(msg_hdr);
struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg_hdr);
+ assert(cmsg);
*cmsg = g_pipe_msg_ctl;
memcpy(CMSG_DATA(cmsg), &pipefd, sizeof(pipefd));
}
|| header.result != DLOG_REQ_RESULT_OK)
return -EINVAL;
- *datalen = header.length - sizeof header;
+ // Cast necessary to avoid unsigned math, as both args are unsigned
+ *datalen = (int)header.length - (int)sizeof header;
if (*datalen < 0)
return -EINVAL;
if (*datalen == 0) {