diff mbox series

[liburing,v1,08/10] test/232c93d07b74: Fix reading from uninitialized buffer

Message ID 20220810002735.2260172-9-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>

Fix this:

  ==2255860== Thread 2:
  ==2255860== Conditional jump or move depends on uninitialised value(s)
  ==2255860==    at 0x10A073: rcv (232c93d07b74.c:150)
  ==2255860==    by 0x490EB42: start_thread (pthread_create.c:442)
  ==2255860==    by 0x499FBB3: clone (clone.S:100)
  ==2255860==
  ==2255860== Conditional jump or move depends on uninitialised value(s)
  ==2255860==    at 0x10A0B6: rcv (232c93d07b74.c:150)
  ==2255860==    by 0x490EB42: start_thread (pthread_create.c:442)
  ==2255860==    by 0x499FBB3: clone (clone.S:100)

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

Patch

diff --git a/test/232c93d07b74.c b/test/232c93d07b74.c
index c99491f..4dc12c1 100644
--- a/test/232c93d07b74.c
+++ b/test/232c93d07b74.c
@@ -121,7 +121,7 @@  static void *rcv(void *arg)
 	int done = 0;
 
 	while (!done && bytes_read != 33) {
-		char buff[RECV_BUFF_SIZE];
+		char buff[RECV_BUFF_SIZE] = { };
 		struct iovec iov;
 
 		iov.iov_base = buff;