From: Pauli Date: Tue, 30 Jul 2019 21:19:33 +0000 (+1000) Subject: Check for NULL return from zalloc in dh_dupctx. X-Git-Tag: openssl-3.0.0-alpha1~1698 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=02c163ea8936d75c7334d81d86c2a713dea40371;p=oweals%2Fopenssl.git Check for NULL return from zalloc in dh_dupctx. Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9485) --- diff --git a/providers/common/exchange/dh_exch.c b/providers/common/exchange/dh_exch.c index b4bfd5f419..62041daab3 100644 --- a/providers/common/exchange/dh_exch.c +++ b/providers/common/exchange/dh_exch.c @@ -106,6 +106,8 @@ static void *dh_dupctx(void *vpdhctx) PROV_DH_CTX *dstctx; dstctx = OPENSSL_zalloc(sizeof(*srcctx)); + if (dstctx == NULL) + return NULL; *dstctx = *srcctx; if (dstctx->dh != NULL && !DH_up_ref(dstctx->dh)) {