summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-11 15:03:42 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-08-24 11:19:28 +1000
commit3c1ccfea85e6dcb93aba5cfb166d7aa88bd0a587 (patch)
treeed96ad3f0880b6a904db7cef9c331ae8ccbf9a10 /crypto/evp
parent05ead000650b885deaf48b08509e8d14a5b7dd78 (diff)
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)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/p_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 7a79816788..503009dd93 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -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;