swrap: Make sure cmbuf is not NULL.
authorAndreas Schneider <asn@samba.org>
Tue, 27 May 2014 07:09:24 +0000 (09:09 +0200)
committerAndreas Schneider <asn@samba.org>
Tue, 27 May 2014 07:51:43 +0000 (09:51 +0200)
CID 63532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
src/socket_wrapper.c

index 7275e73afef1b50cbb0c658bdf0308e8ea4b33f5..b8b1ca35fdc8f560fa89c23d43ff44a1fb0798c4 100644 (file)
@@ -3441,7 +3441,7 @@ static ssize_t swrap_sendmsg_before(int fd,
                if (cmlen == 0) {
                        msg->msg_controllen = 0;
                        msg->msg_control = NULL;
-               } else if (cmlen < msg->msg_controllen) {
+               } else if (cmlen < msg->msg_controllen && cmbuf != NULL) {
                        memcpy(msg->msg_control, cmbuf, cmlen);
                        msg->msg_controllen = cmlen;
                }