From: Pauli Date: Wed, 20 Nov 2019 22:41:42 +0000 (+1000) Subject: PROV: Avoid NULL dereference in SHA3 dup call. X-Git-Tag: openssl-3.0.0-alpha1~917 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a89befba602353ff2fc83ba7037eb91307b2cb21;p=oweals%2Fopenssl.git PROV: Avoid NULL dereference in SHA3 dup call. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10487) --- 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; }