From 469b65b9cbe42177c0475052ad76587da1446f36 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 21 Apr 2020 09:13:49 +0200 Subject: [PATCH] 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 Reviewed-by: Gert Wollny --- vtest/vtest_renderer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index d8071ba..b7ee18a 100644 --- a/vtest/vtest_renderer.c +++ b/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));