summaryrefslogtreecommitdiffstats
path: root/crypto/evp/p_lib.c
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2015-09-01 16:31:55 +0200
committerEmilia Kasper <emilia@openssl.org>2015-09-10 17:21:23 +0200
commite34c66c6b07d69ec4df8e488976e28d851ad87e6 (patch)
tree34cb0273ddc02f0d2a30c045d4b2dd429b7cdd67 /crypto/evp/p_lib.c
parentcdde7b49a4ded6ce25b348314a231b99ce884c06 (diff)
RT3754: check for NULL pointer
Fix both the caller to error out on malloc failure, as well as the eventual callee to handle a NULL gracefully. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
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 daa3d57c02..f07d7e5e4f 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -261,7 +261,7 @@ int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len)
int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
{
- if (!EVP_PKEY_set_type(pkey, type))
+ if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
return 0;
pkey->pkey.ptr = key;
return (key != NULL);