summaryrefslogtreecommitdiffstats
path: root/crypto/evp/p_lib.c
diff options
context:
space:
mode:
authorjwalch <jeremy.walch@gmail.com>2020-09-09 22:36:00 -0400
committerTomas Mraz <tmraz@fedoraproject.org>2020-09-17 09:36:52 +0200
commit4bb73d5409c056a878f526280f86cc3c01f8cd68 (patch)
tree42e6f7ee3b30f4346f58d9cf36a4cee7950775a2 /crypto/evp/p_lib.c
parent8230710f04ed70fee41ec3ed8f3e4b1af55be05a (diff)
Add a NULL check to EVP_PKEY_assign
Fixes #12619 Update p_lib.c Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12863)
Diffstat (limited to 'crypto/evp/p_lib.c')
-rw-r--r--crypto/evp/p_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index e336d91286..5e032b4053 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -709,7 +709,7 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
int alias = type;
#ifndef OPENSSL_NO_EC
- if (EVP_PKEY_type(type) == EVP_PKEY_EC) {
+ if ((key != NULL) && (EVP_PKEY_type(type) == EVP_PKEY_EC)) {
const EC_GROUP *group = EC_KEY_get0_group(key);
if (group != NULL && EC_GROUP_get_curve_name(group) == NID_sm2)