From 9884568569feb559cea2496a3326259a53db0860 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Thu, 11 Jul 2024 16:04:28 -0400 Subject: [PATCH] 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) --- test/evp_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"; -- 2.47.2