From: Pauli Date: Thu, 31 Mar 2022 21:06:17 +0000 (+1100) Subject: kdf: avoid NULL dereference on malloc failure in sshkdf X-Git-Tag: openssl-3.2.0-alpha1~2777 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=148176ca323e3dfce5d5cdb5578c113c8d2440bb;p=thirdparty%2Fopenssl.git kdf: avoid NULL dereference on malloc failure in sshkdf Fixes #18009 Reviewed-by: Tomas Mraz Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/18011) --- diff --git a/providers/implementations/kdfs/sshkdf.c b/providers/implementations/kdfs/sshkdf.c index 6c1cf7e615d..a8b23a705cf 100644 --- a/providers/implementations/kdfs/sshkdf.c +++ b/providers/implementations/kdfs/sshkdf.c @@ -60,7 +60,8 @@ static void *kdf_sshkdf_new(void *provctx) if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE); - ctx->provctx = provctx; + else + ctx->provctx = provctx; return ctx; }