From: Richard Levitte Date: Wed, 5 Jun 2002 11:58:23 +0000 (+0000) Subject: Check errors when parsing a PKCS8INF PEM FILE, or there will be a core dump on error. X-Git-Tag: OpenSSL_0_9_7-beta2~32 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=231360a3b7d4f5ef338e3172694686cc5d9807ec;p=oweals%2Fopenssl.git Check errors when parsing a PKCS8INF PEM FILE, or there will be a core dump on error. PR: 77 --- diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 270892d72b..d96ecf6940 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -85,6 +85,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, vo else if (strcmp(nm,PEM_STRING_PKCS8INF) == 0) { PKCS8_PRIV_KEY_INFO *p8inf; p8inf=d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, len); + if(!p8inf) goto p8err; ret = EVP_PKCS82PKEY(p8inf); PKCS8_PRIV_KEY_INFO_free(p8inf); } else if (strcmp(nm,PEM_STRING_PKCS8) == 0) {