Fix for a bug in PKCS#7 code and non-detached data.
[openssl.git] / crypto / pkcs7 / pk7_doit.c
index 4c32f053b7e0cfaaac8306c141e42b3d75f42ce9..7feb01230eaeab6e3ac84b4ee63bda75f90fbe7b 100644 (file)
@@ -226,7 +226,8 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
                                os=p7->d.sign->contents->d.data;
                                if (os->length > 0) bio = 
                                        BIO_new_mem_buf(os->data, os->length);
-                       } else {
+                       } 
+                       if(bio == NULL) {
                                bio=BIO_new(BIO_s_mem());
                                BIO_set_mem_eof_return(bio,0);
                        }