swrap: Make sure cmbuf is not NULL.
authorAndreas Schneider <asn@samba.org>
Tue, 3 Jun 2014 13:07:07 +0000 (15:07 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 5 Jun 2014 21:57:10 +0000 (23:57 +0200)
CID 63532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/socket_wrapper/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;
                }