diff mbox series

[liburing,v1,07/10] test/submit-link-fail: Initialize the buffer before `write()`

Message ID 20220810002735.2260172-8-ammar.faizi@intel.com (mailing list archive)
State New
Headers show
Series liburing test fixes | expand

Commit Message

Ammar Faizi Aug. 10, 2022, 12:31 a.m. UTC
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>

... to avoid valgrind's complaint:

  ==2254978== Syscall param write(buf) points to uninitialised byte(s)
  ==2254978==    at 0x498EA37: write (write.c:26)
  ==2254978==    by 0x109F17: test_underprep_fail (submit-link-fail.c:82)
  ==2254978==    by 0x109F17: main (submit-link-fail.c:141)
  ==2254978==  Address 0x1ffefffb07 is on thread 1's stack
  ==2254978==  in frame #1, created by main (submit-link-fail.c:123)

Link: https://github.com/axboe/liburing/issues/640
Reported-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 test/submit-link-fail.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/submit-link-fail.c b/test/submit-link-fail.c
index 45f6976..e62f793 100644
--- a/test/submit-link-fail.c
+++ b/test/submit-link-fail.c
@@ -23,7 +23,7 @@  static int test_underprep_fail(bool hardlink, bool drain, bool link_last,
 	struct io_uring ring;
 	struct io_uring_sqe *sqe;
 	struct io_uring_cqe *cqe;
-	char buffer[1];
+	char buffer[1] = { };
 	int i, ret, fds[2];
 
 	if (drain)