Check errors when parsing a PKCS8INF PEM FILE, or there will be a core dump on error.
authorRichard Levitte <levitte@openssl.org>
Wed, 5 Jun 2002 11:58:29 +0000 (11:58 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 5 Jun 2002 11:58:29 +0000 (11:58 +0000)
PR: 77

crypto/pem/pem_pkey.c

index 0e3faffa4416a7f829f4943fd22fe0b3967c3243..7d9f30277772383aec3ed81b6c2156c7875295f0 100644 (file)
@@ -87,6 +87,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) {