From 02c163ea8936d75c7334d81d86c2a713dea40371 Mon Sep 17 00:00:00 2001 From: Pauli Date: Wed, 31 Jul 2019 07:19:33 +1000 Subject: [PATCH] Check for NULL return from zalloc in dh_dupctx. Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9485) --- providers/common/exchange/dh_exch.c | 2 ++ 1 file changed, 2 insertions(+) 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)) { -- 2.25.1