From ba3ea453b0863a8b7374003dd2e22dea9cece5be Mon Sep 17 00:00:00 2001 From: Shane Lontis Date: Wed, 2 Jun 2021 14:42:56 +1000 Subject: [PATCH] Fix errors found by parfait static analyser. Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15579) --- crypto/evp/kdf_lib.c | 2 +- providers/implementations/macs/cmac_prov.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.3