commit | 148176ca323e3dfce5d5cdb5578c113c8d2440bb | [log] [tgz] |
---|---|---|
author | Pauli <pauli@openssl.org> | Fri Apr 01 08:06:17 2022 +1100 |
committer | Pauli <pauli@openssl.org> | Mon Apr 11 09:53:34 2022 +1000 |
tree | c961957e44d022111e623bef099d392ee8b65f30 | |
parent | eb27a90e41a62d3337c5e21e24ee72f1e49a445c [diff] |
kdf: avoid NULL dereference on malloc failure in sshkdf Fixes #18009 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/18011)
diff --git a/providers/implementations/kdfs/sshkdf.c b/providers/implementations/kdfs/sshkdf.c index 6c1cf7e..a8b23a7 100644 --- a/providers/implementations/kdfs/sshkdf.c +++ b/providers/implementations/kdfs/sshkdf.c
@@ -60,7 +60,8 @@ 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; }