SHA256
1
0
forked from pool/kmod
kmod/0001-testsuite-repair-read-of-uninitialized-memory.patch

34 lines
1.1 KiB
Diff
Raw Normal View History

From 16c086f48c2270ad6412ad7226df53079f825270 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Thu, 30 Jun 2022 18:47:25 +0200
Subject: [PATCH] testsuite: repair read of uninitialized memory
References: https://github.com/kmod-project/kmod/pull/15
References: https://github.com/kmod-project/kmod/issues/14
Function ``test_backoff_time`` does not initialize ``delta``, and
``get_backoff_delta_msec`` then performs a read from uninitialized
memory with the ``!*delta`` expression.
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
---
testsuite/test-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testsuite/test-util.c b/testsuite/test-util.c
index fb8c9ef..5766584 100644
--- a/testsuite/test-util.c
+++ b/testsuite/test-util.c
@@ -231,7 +231,7 @@ DEFINE_TEST(test_addu64_overflow,
static int test_backoff_time(const struct test *t)
{
- unsigned long long delta;
+ unsigned long long delta = 0;
/* Check exponential increments */
get_backoff_delta_msec(now_msec(), now_msec() + 10, &delta);
--
2.36.1