]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix errors found by parfait static analyser.
authorShane Lontis <shane.lontis@oracle.com>
Wed, 2 Jun 2021 04:42:56 +0000 (14:42 +1000)
committerPauli <pauli@openssl.org>
Thu, 3 Jun 2021 06:15:41 +0000 (16:15 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15579)

crypto/evp/kdf_lib.c
providers/implementations/macs/cmac_prov.c

index 77080e0b8df2bb1f58d00967e81be856933582f4..5552b2660114b1c735bbcc0f8dd13b436e2432f2 100644 (file)
@@ -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;
index 4f8450475cf8406e0388af4ea362b5d36e17855d..229127603511f87b8929b79aa2c3a7cf3b737d4d 100644 (file)
@@ -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);