diff --git a/NEWS b/NEWS index 5f3ce329a2d..708dded9eaa 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ PHP NEWS - Opcache: . Fixed build for macOS to cater with pkg-config settings. (David Carlier) +- OpenSSL: + . Add missing error checks on file writing functions. (nielsdos) + - Phar: . Fixed bug GH-10766 (PharData archive created with Phar::Zip format does not keep files metadata (datetime)). (nielsdos) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 408b93c6e85..10af453c895 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -5406,7 +5406,11 @@ PHP_FUNCTION(openssl_pkcs7_verify) } if (p7bout) { - PEM_write_bio_PKCS7(p7bout, p7); + if (PEM_write_bio_PKCS7(p7bout, p7) == 0) { + php_error_docref(NULL, E_WARNING, "Failed to write PKCS7 to file"); + php_openssl_store_errors(); + RETVAL_FALSE; + } } } } else {