[PATCH liburing v1 10/10] test/file-register: Fix reading from uninitialized buffer

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

 



From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>

Fix this:

  ==2256677== Conditional jump or move depends on uninitialised value(s)
  ==2256677==    at 0x485207E: bcmp (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==2256677==    by 0x10BEAE: test_fixed_read_write (file-register.c:489)
  ==2256677==    by 0x10AED2: test_skip (file-register.c:595)
  ==2256677==    by 0x10AED2: main (file-register.c:1087)

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

diff --git a/test/file-register.c b/test/file-register.c
index 634ef81..0a8aa57 100644
--- a/test/file-register.c
+++ b/test/file-register.c
@@ -431,7 +431,7 @@ static int test_fixed_read_write(struct io_uring *ring, int index)
 	iov[0].iov_len = 4096;
 	memset(iov[0].iov_base, 0x5a, 4096);
 
-	iov[1].iov_base = t_malloc(4096);
+	iov[1].iov_base = t_calloc(1, 4096);
 	iov[1].iov_len = 4096;
 
 	sqe = io_uring_get_sqe(ring);
-- 
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