Skip to content

Commit 02fcd99

Browse files
committed
openssl: Fix missing error propagation in openssl_x509_export()
The file writes can have failed, but this error isn't visible for the application, fix it by propagating the error properly.
1 parent fb80f35 commit 02fcd99

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ext/openssl/openssl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,8 +1872,7 @@ PHP_FUNCTION(openssl_x509_export)
18721872
}
18731873
if (!notext && !X509_print(bio_out, cert)) {
18741874
php_openssl_store_errors();
1875-
}
1876-
if (PEM_write_bio_X509(bio_out, cert)) {
1875+
} else if (PEM_write_bio_X509(bio_out, cert)) {
18771876
BUF_MEM *bio_buf;
18781877

18791878
BIO_get_mem_ptr(bio_out, &bio_buf);

0 commit comments

Comments
 (0)