aio_fork: Fix CID 1273291 Uninitialized scalar variable
authorVolker Lendecke <vl@samba.org>
Tue, 3 Mar 2015 14:48:46 +0000 (15:48 +0100)
committerRalph Böhme <slow@samba.org>
Tue, 3 Mar 2015 16:34:38 +0000 (17:34 +0100)
The previous code left msg.msg_flags uninitialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_aio_fork.c

index bf29dd1e0182dabd8f1580e741d079a9e6da3a98..06f38c2a695591f50c6945e7482999b0e0407df3 100644 (file)
@@ -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;