From ddb84ef2d39524149ffe74d752993ca93547b9be Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 3 Mar 2015 15:48:46 +0100 Subject: [PATCH] aio_fork: Fix CID 1273291 Uninitialized scalar variable The previous code left msg.msg_flags uninitialized Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/modules/vfs_aio_fork.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c index bf29dd1e018..06f38c2a695 100644 --- a/source3/modules/vfs_aio_fork.c +++ b/source3/modules/vfs_aio_fork.c @@ -203,15 +203,13 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd) static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd) { - struct msghdr msg; + struct msghdr msg = {0}; size_t bufsize = msghdr_prep_fds(NULL, NULL, 0, &sendfd, 1); uint8_t buf[bufsize]; struct iovec iov; ssize_t sent; msghdr_prep_fds(&msg, buf, bufsize, &sendfd, 1); - msg.msg_name = NULL; - msg.msg_namelen = 0; iov.iov_base = (void *)ptr; iov.iov_len = nbytes; -- 2.34.1