diff mbox series

[liburing,v1,06/10] test/statx: Fix reading from uninitialized buffer

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

  ==3062618== Conditional jump or move depends on uninitialised value(s)
  ==3062618==    at 0x484D65E: bcmp (vg_replace_strmem.c:1129)
  ==3062618==    by 0x109304: test_statx (statx.c:71)
  ==3062618==    by 0x109304: main (statx.c:149)

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

Patch

diff --git a/test/statx.c b/test/statx.c
index 5fa086e..4ae3452 100644
--- a/test/statx.c
+++ b/test/statx.c
@@ -40,7 +40,7 @@  static int test_statx(struct io_uring *ring, const char *path)
 {
 	struct io_uring_cqe *cqe;
 	struct io_uring_sqe *sqe;
-	struct statx x1, x2;
+	struct statx x1 = { }, x2 = { };
 	int ret;
 
 	sqe = io_uring_get_sqe(ring);