From: Jens Axboe Date: Wed, 13 Dec 2017 15:44:34 +0000 (-0700) Subject: server: initialize first iolog header properly X-Git-Tag: fio-3.3~13 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c20c361255683ee138f0c239e48b315e25725f7e;ds=sidebyside server: initialize first iolog header properly We're sending potential stack garbage over the wire, init the whole pdu to zeroes before filling it in. This shuts up valgrind about using uninitialized memory. Signed-off-by: Jens Axboe --- diff --git a/server.c b/server.c index 76d662d4..62256141 100644 --- a/server.c +++ b/server.c @@ -1933,6 +1933,7 @@ int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name) struct flist_head *entry; int ret = 0; + memset(&pdu, 0, sizeof(pdu)); pdu.nr_samples = cpu_to_le64(iolog_nr_samples(log)); pdu.thread_number = cpu_to_le32(td->thread_number); pdu.log_type = cpu_to_le32(log->log_type);