From: Shane Lontis Date: Wed, 2 Jun 2021 04:42:56 +0000 (+1000) Subject: Fix errors found by parfait static analyser. X-Git-Tag: openssl-3.0.0-beta1~224 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba3ea453b0863a8b7374003dd2e22dea9cece5be;p=thirdparty%2Fopenssl.git Fix errors found by parfait static analyser. Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15579) --- diff --git a/crypto/evp/kdf_lib.c b/crypto/evp/kdf_lib.c index 77080e0b8df..5552b266011 100644 --- a/crypto/evp/kdf_lib.c +++ b/crypto/evp/kdf_lib.c @@ -125,7 +125,7 @@ void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx) size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx) { OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END }; - size_t s; + size_t s = 0; if (ctx == NULL) return 0; diff --git a/providers/implementations/macs/cmac_prov.c b/providers/implementations/macs/cmac_prov.c index 4f8450475cf..22912760351 100644 --- a/providers/implementations/macs/cmac_prov.c +++ b/providers/implementations/macs/cmac_prov.c @@ -87,6 +87,8 @@ static void *cmac_dup(void *vsrc) return NULL; dst = cmac_new(src->provctx); + if (dst == NULL) + return NULL; if (!CMAC_CTX_copy(dst->ctx, src->ctx) || !ossl_prov_cipher_copy(&dst->cipher, &src->cipher)) { cmac_free(dst);