mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Fix coverity CID #1465594 - Null dereference in EVP_PKEY_get0()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12628)
This commit is contained in:
parent
05ead00065
commit
3c1ccfea85
@ -720,6 +720,8 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
|
||||
|
||||
void *EVP_PKEY_get0(const EVP_PKEY *pkey)
|
||||
{
|
||||
if (pkey == NULL)
|
||||
return NULL;
|
||||
if (!evp_pkey_downgrade((EVP_PKEY *)pkey)) {
|
||||
ERR_raise(ERR_LIB_EVP, EVP_R_INACCESSIBLE_KEY);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user