]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/wpackettest.c: remove bogus cleanup() in test_WPACKET_quic_vlint_random()
authorEugene Syromiatnikov <esyr@openssl.org>
Mon, 15 Sep 2025 02:05:04 +0000 (04:05 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 25 Sep 2025 14:59:11 +0000 (16:59 +0200)
In the beginning of the iteration, pkt is not initialised yet, so there
is no need to clean it up on RAND_bytes() failure.  Replace
"return cleanup(&pkt)" with plain "return 0".

Fixes: 416d0a638c16 "QUIC wire format support"
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1665422
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28647)

(cherry picked from commit 732a0a5df8324240e115d599c79487844d64efec)

test/wpackettest.c

index bd696e00740784a464e926bbb78ae87ca4b5a508..c6d6faf5c4855045904720cee9708382f02eef17 100644 (file)
@@ -588,7 +588,7 @@ static int test_WPACKET_quic_vlint_random(void)
 
     for (i = 0; i < 10000; ++i) {
         if (!TEST_int_gt(RAND_bytes(rand_data, sizeof(rand_data)), 0))
-            return cleanup(&pkt);
+            return 0;
 
         memcpy(&expected, rand_data, sizeof(expected));