Uhmmm, if we use && after having tested for the presence of the certificate,
authorRichard Levitte <levitte@openssl.org>
Tue, 23 Apr 2002 13:15:27 +0000 (13:15 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 23 Apr 2002 13:15:27 +0000 (13:15 +0000)
we just *might* stand a certain chance of actually getting it written
to file...

crypto/pem/pem_info.c

index 453fa2db34b6dab54ac677e4a486ef180a4eaab9..9a6dffb45cfd0f6bf0e69240ca7966a648e62b8b 100644 (file)
@@ -346,7 +346,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
                }
 
        /* if we have a certificate then write it out now */
-       if ((xi->x509 != NULL) || (PEM_write_bio_X509(bp,xi->x509) <= 0))
+       if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp,xi->x509) <= 0))
                goto err;
 
        /* we are ignoring anything else that is loaded into the X509_INFO