mirror of
https://github.com/openssl/openssl.git
synced 2025-01-24 13:55:42 +08:00
Crypto/evp: Fix null pointer dereference
Check the return value of EVP_KDF_fetch to avoid a potential null pointer dereference. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18062)
This commit is contained in:
parent
148176ca32
commit
5f1424c6bd
@ -42,6 +42,8 @@ int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
|
||||
salt = (unsigned char *)empty;
|
||||
|
||||
kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_PBKDF2, propq);
|
||||
if (kdf == NULL)
|
||||
return 0;
|
||||
kctx = EVP_KDF_CTX_new(kdf);
|
||||
EVP_KDF_free(kdf);
|
||||
if (kctx == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user