summaryrefslogtreecommitdiffstats
path: root/lib/socket_wrapper/socket_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/socket_wrapper/socket_wrapper.c')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 7275e73afe..b8b1ca35fd 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -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;
}