From a89befba602353ff2fc83ba7037eb91307b2cb21 Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 21 Nov 2019 08:41:42 +1000 Subject: [PATCH] PROV: Avoid NULL dereference in SHA3 dup call. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10487) --- providers/implementations/digests/sha3_prov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/implementations/digests/sha3_prov.c b/providers/implementations/digests/sha3_prov.c index 251039e992..44471959a7 100644 --- a/providers/implementations/digests/sha3_prov.c +++ b/providers/implementations/digests/sha3_prov.c @@ -241,7 +241,8 @@ static void *keccak_dupctx(void *ctx) KECCAK1600_CTX *in = (KECCAK1600_CTX *)ctx; KECCAK1600_CTX *ret = OPENSSL_malloc(sizeof(*ret)); - *ret = *in; + if (ret != NULL) + *ret = *in; return ret; } -- 2.25.1