1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  phar: Fix file descriptor leak in phar_zip_flush() on failure.
This commit is contained in:
Niels Dossche
2025-10-21 19:36:30 +02:00
2 changed files with 2 additions and 0 deletions

1
NEWS
View File

@@ -60,6 +60,7 @@ PHP NEWS
. Fix potential buffer length truncation due to usage of type int instead
of type size_t. (Girgias)
. Fix memory leak when openssl polyfill returns garbage. (nielsdos)
. Fix file descriptor leak in phar_zip_flush() on failure. (nielsdos)
- Random:
. Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos)

View File

@@ -1276,6 +1276,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def
return;
}
if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
php_stream_close(entry.fp);
if (error) {
spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname);
}