Skip to content

Commit 3affdbb

Browse files
committed
Add missing error check on PEM_write_bio_PKCS7()
1 parent a239247 commit 3affdbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/openssl/openssl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5404,7 +5404,11 @@ PHP_FUNCTION(openssl_pkcs7_verify)
54045404
}
54055405

54065406
if (p7bout) {
5407-
PEM_write_bio_PKCS7(p7bout, p7);
5407+
if (PEM_write_bio_PKCS7(p7bout, p7) == 0) {
5408+
php_error_docref(NULL, E_WARNING, "Failed to write PKCS7 to file");
5409+
php_openssl_store_errors();
5410+
RETVAL_FALSE;
5411+
}
54085412
}
54095413
}
54105414
} else {

0 commit comments

Comments
 (0)