[PATCH liburing v1 05/10] test/fpos: Fix reading from uninitialized buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>

Fix this:

  ==3054875== Conditional jump or move depends on uninitialised value(s)
  ==3054875==    at 0x109898: test_read (fpos.c:109)
  ==3054875==    by 0x109898: main (fpos.c:243)
  ==3054875==
  ==3054875== Conditional jump or move depends on uninitialised value(s)
  ==3054875==    at 0x10987B: test_read (fpos.c:111)
  ==3054875==    by 0x10987B: main (fpos.c:243)

Link: https://github.com/axboe/liburing/issues/640
Reported-by: Vitaly Chikunov <vt@xxxxxxxxxxxx>
Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
---
 test/fpos.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/fpos.c b/test/fpos.c
index 4ffa22d..4c36f11 100644
--- a/test/fpos.c
+++ b/test/fpos.c
@@ -52,6 +52,9 @@ static int test_read(struct io_uring *ring, bool async, int blocksize)
 	unsigned char buff[QUEUE_SIZE * blocksize];
 	unsigned char reordered[QUEUE_SIZE * blocksize];
 
+	memset(buff, 0, QUEUE_SIZE * blocksize);
+	memset(reordered, 0, QUEUE_SIZE * blocksize);
+
 	create_file(".test_fpos_read", FILE_SIZE);
 	fd = open(".test_fpos_read", O_RDONLY);
 	unlink(".test_fpos_read");
-- 
Ammar Faizi




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux