1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

aio_fork: Fix CID 1273291 Uninitialized scalar variable

The previous code left msg.msg_flags uninitialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2015-03-03 15:48:46 +01:00 committed by Ralph Böhme
parent 7be3a5f92d
commit ddb84ef2d3

View 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;