]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix coverity-1510058
authorNeil Horman <nhorman@openssl.org>
Thu, 11 Jul 2024 20:04:28 +0000 (16:04 -0400)
committerPauli <ppzgs1@gmail.com>
Mon, 15 Jul 2024 00:10:00 +0000 (10:10 +1000)
coverity noted a recent change made a call to OSSL_PARAM_get_size_t
without checking the return code, as is practice in all other call
sites.

Just add the check.

Fixes openssl/private#551

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24860)

test/evp_test.c

index 9ebcd29e09fa60a03540fb753a4045a9911edf92..c14cb196f4d6329d2eaf59ef0f49c2dc0c67279c 100644 (file)
@@ -1863,8 +1863,10 @@ static int mac_test_run_mac(EVP_TEST *t)
         goto err;
 
     p = OSSL_PARAM_locate(params + params_n_allocstart, "size");
-    if (p != NULL)
-        OSSL_PARAM_get_size_t(p, &size_val);
+    if (p != NULL) {
+        if (!OSSL_PARAM_get_size_t(p, &size_val))
+            goto err;
+    }
 
     if ((ctx = EVP_MAC_CTX_new(expected->mac)) == NULL) {
         t->err = "MAC_CREATE_ERROR";