summaryrefslogtreecommitdiffstats
path: root/crypto/engine
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-11-20 13:07:04 +1000
committerPauli <paul.dale@oracle.com>2019-11-21 14:31:58 +1000
commit9bada854de16bcc1a9dc199b4b352b19ab6897fc (patch)
tree9788acd8f1d1a24c1cfa255635185d8d381b1204 /crypto/engine
parentcff7d199e0dc51ae939de5fb7702aab2a9ef30fc (diff)
Engine: Add NULL check.
Add NULL check for return from pkey_asn1_meths. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10473)
Diffstat (limited to 'crypto/engine')
-rw-r--r--crypto/engine/tb_asnmth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/engine/tb_asnmth.c b/crypto/engine/tb_asnmth.c
index 5e356312a0..6289c225a5 100644
--- a/crypto/engine/tb_asnmth.c
+++ b/crypto/engine/tb_asnmth.c
@@ -147,7 +147,8 @@ const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
nidcount = e->pkey_asn1_meths(e, NULL, &nids, 0);
for (i = 0; i < nidcount; i++) {
e->pkey_asn1_meths(e, &ameth, NULL, nids[i]);
- if (((int)strlen(ameth->pem_str) == len)
+ if (ameth != NULL
+ && ((int)strlen(ameth->pem_str) == len)
&& strncasecmp(ameth->pem_str, str, len) == 0)
return ameth;
}