]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
evp_test.c: There are now 3 parameters possible for digests
authorTomas Mraz <tomas@openssl.org>
Thu, 26 Oct 2023 07:59:22 +0000 (09:59 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 30 Oct 2023 09:54:05 +0000 (10:54 +0100)
In digest_test_run() there are now 3 parameters possible plus
the sentinel value. In reality we will never use all three
at once but Coverity rightfully complains that it is possible
to overflow the params array.

Fixes Coverity 1548054

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22521)

test/evp_test.c

index 487d6a1ad2e06e9c8c5e980a39f7a69c0fd0f6fc..d74da09616c502702512111e9649564326f0285f 100644 (file)
@@ -458,7 +458,7 @@ static int digest_test_run(EVP_TEST *t)
     unsigned int got_len;
     size_t size = 0;
     int xof = 0;
-    OSSL_PARAM params[3], *p = &params[0];
+    OSSL_PARAM params[4], *p = &params[0];
 
     t->err = "TEST_FAILURE";
     if (!TEST_ptr(mctx = EVP_MD_CTX_new()))