summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-11-21 08:41:42 +1000
committerPauli <paul.dale@oracle.com>2019-11-22 15:20:54 +1000
commita89befba602353ff2fc83ba7037eb91307b2cb21 (patch)
treebcc651efc0479933230f64b1605e82b447cd5ef4 /providers
parentc676ff42b0ef35b9d04fdc5e9c71baff603a3dbf (diff)
PROV: Avoid NULL dereference in SHA3 dup call.
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10487)
Diffstat (limited to 'providers')
-rw-r--r--providers/implementations/digests/sha3_prov.c3
1 files changed, 2 insertions, 1 deletions
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;
}