summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pem_info.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2007-04-05 18:58:39 +0200
committerBen Laurie <ben@openssl.org>2007-04-05 18:58:39 +0200
commit8bbf6ac01056f6e5bba5fd5950fc0356f31cef5b (patch)
tree41ccf5a9eac887545bad9160f902f1aa58f8ab85 /crypto/pem/pem_info.c
parentMissing config file. (diff)
downloadopenssl-8bbf6ac01056f6e5bba5fd5950fc0356f31cef5b.tar.xz
openssl-8bbf6ac01056f6e5bba5fd5950fc0356f31cef5b.zip
Don't dereference NULL argument. Coverity ID 52.
Diffstat (limited to 'crypto/pem/pem_info.c')
-rw-r--r--crypto/pem/pem_info.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/pem/pem_info.c b/crypto/pem/pem_info.c
index 7382b61995..1b2be527ed 100644
--- a/crypto/pem/pem_info.c
+++ b/crypto/pem/pem_info.c
@@ -339,6 +339,12 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
{
if ( (xi->enc_data!=NULL) && (xi->enc_len>0) )
{
+ if (enc == NULL)
+ {
+ PEMerr(PEM_F_PEM_X509_INFO_WRITE_BIO,PEM_R_CIPHER_IS_NULL);
+ goto err;
+ }
+
/* copy from weirdo names into more normal things */
iv=xi->enc_cipher.iv;
data=(unsigned char *)xi->enc_data;