From: Neil Horman Date: Thu, 11 Jul 2024 20:04:28 +0000 (-0400) Subject: Fix coverity-1510058 X-Git-Tag: openssl-3.4.0-alpha1~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9884568569feb559cea2496a3326259a53db0860;p=thirdparty%2Fopenssl.git Fix coverity-1510058 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 Reviewed-by: Tom Cosgrove Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/24860) --- diff --git a/test/evp_test.c b/test/evp_test.c index 9ebcd29e09f..c14cb196f4d 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -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";