Skip to content

Commit

Permalink
kdf: avoid NULL dereference on malloc failure in sshkdf
Browse files Browse the repository at this point in the history
Fixes #18009

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from #18011)
  • Loading branch information
paulidale committed Apr 10, 2022
1 parent eb27a90 commit 148176c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/implementations/kdfs/sshkdf.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 148176c

Please sign in to comment.