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:16 +0000 (11:58 +0000)
committerRichard Levitte <levitte@openssl.org>
Wed, 5 Jun 2002 11:58:16 +0000 (11:58 +0000)
PR: 77

crypto/pem/pem_lib.c

index e00af7c0184211ed59811d48b26c2f1e6320ed6d..01759f75c3b548135055602b777ec57dd3b6bc21 100644 (file)
@@ -258,6 +258,7 @@ char *PEM_ASN1_read_bio(char *(*d2i)(), const char *name, BIO *bp, char **x,
                        PKCS8_PRIV_KEY_INFO *p8inf;
                        p8inf=d2i_PKCS8_PRIV_KEY_INFO(
                                        (PKCS8_PRIV_KEY_INFO **) x, &p, len);
+                       if(!p8inf) goto p8err;
                        ret = (char *)EVP_PKCS82PKEY(p8inf);
                        PKCS8_PRIV_KEY_INFO_free(p8inf);
                } else if (strcmp(nm,PEM_STRING_PKCS8) == 0) {