summaryrefslogtreecommitdiffstats
path: root/providers/common
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-07-30 23:19:33 +0200
committerPauli <paul.dale@oracle.com>2019-07-31 07:50:49 +0200
commit02c163ea8936d75c7334d81d86c2a713dea40371 (patch)
tree4aa0bf603c8f0bc6abe838a551c73461372f12ed /providers/common
parentAvoid using ERR_put_error() directly in OpenSSL code (diff)
downloadopenssl-02c163ea8936d75c7334d81d86c2a713dea40371.tar.xz
openssl-02c163ea8936d75c7334d81d86c2a713dea40371.zip
Check for NULL return from zalloc in dh_dupctx.
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9485)
Diffstat (limited to 'providers/common')
-rw-r--r--providers/common/exchange/dh_exch.c2
1 files changed, 2 insertions, 0 deletions
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)) {