]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: repair read of uninitialized memory
authorJan Engelhardt <jengelh@inai.de>
Thu, 30 Jun 2022 16:47:25 +0000 (18:47 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 30 Jun 2022 16:54:23 +0000 (09:54 -0700)
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

index fb8c9ef2240c228b60415082441d7ec2a36a12be..5766584e3e7fcd6a34d60a790868de6ed02b7ca4 100644 (file)
@@ -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);