diff options
author | Pauli <paul.dale@oracle.com> | 2019-11-21 06:47:57 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-11-22 15:20:54 +1000 |
commit | c676ff42b0ef35b9d04fdc5e9c71baff603a3dbf (patch) | |
tree | 91b0e93477dedd4830babf116f2d4003c3a49994 /providers/common/include | |
parent | 3c659415465a29d41cdfb6866683af8690de1527 (diff) |
PROV: check for memory allocation failure in digest _dupctx.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10487)
Diffstat (limited to 'providers/common/include')
-rw-r--r-- | providers/common/include/prov/digestcommon.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/providers/common/include/prov/digestcommon.h b/providers/common/include/prov/digestcommon.h index 868cbbf79f..e5b76ff49f 100644 --- a/providers/common/include/prov/digestcommon.h +++ b/providers/common/include/prov/digestcommon.h @@ -49,7 +49,8 @@ static void *name##_dupctx(void *ctx) \ { \ CTX *in = (CTX *)ctx; \ CTX *ret = OPENSSL_malloc(sizeof(*ret)); \ - *ret = *in; \ + if (ret != NULL) \ + *ret = *in; \ return ret; \ } \ static OSSL_OP_digest_final_fn name##_internal_final; \ |