vtest: Initialize sendmsg iovec contents

To keep Valgrind happy:

==3628== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==3628==    at 0x48DB431: sendmsg (sendmsg.c:28)
==3628==    by 0x10C00E: vtest_create_resource2 (in /virglrenderer/build/vtest/virgl_test_server)
==3628==    by 0x10AC2B: vtest_server_run (in /virglrenderer/build/vtest/virgl_test_server)
==3628==    by 0x10A5B3: main (in /virglrenderer/build/vtest/virgl_test_server)
==3628==  Address 0x1fff0004ef is on thread 1's stack
==3628==  in frame #1, created by vtest_create_resource2 (???:)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Tomeu Vizoso 5 years ago committed by Tomeu Vizoso
parent e24a0328da
commit 469b65b9cb
  1. 3
      vtest/vtest_renderer.c

@ -193,7 +193,8 @@ int vtest_block_read(struct vtest_input *input, void *buf, int size)
static int vtest_send_fd(int socket_fd, int fd)
{
struct iovec iovec;
char buf[CMSG_SPACE(sizeof(int))], c;
char buf[CMSG_SPACE(sizeof(int))];
char c = 0;
struct msghdr msgh = { 0 };
memset(buf, 0, sizeof(buf));

Loading…
Cancel
Save