summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pem_pk8.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-05-28 15:44:20 +0100
committerDr. Stephen Henson <steve@openssl.org>2015-05-28 17:58:03 +0100
commit2849707fa65d2803e6d1c1603fdd3fd1fdc4c6cc (patch)
treee5e538e8a8e827d4ff14e5b270054ee8dae9237f /crypto/pem/pem_pk8.c
parentbca3f06b84de3c0b428724ac535995064c54aee3 (diff)
check for error when creating PKCS#8 structure
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/pem/pem_pk8.c')
-rw-r--r--crypto/pem/pem_pk8.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c
index 4534eb1ec4..ef5131fa29 100644
--- a/crypto/pem/pem_pk8.c
+++ b/crypto/pem/pem_pk8.c
@@ -139,6 +139,8 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid,
if (kstr == buf)
OPENSSL_cleanse(buf, klen);
PKCS8_PRIV_KEY_INFO_free(p8inf);
+ if (p8 == NULL)
+ return 0;
if (isder)
ret = i2d_PKCS8_bio(bp, p8);
else