Skip to content

Commit 40efac0

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: phar: Fix file descriptor leak in phar_zip_flush() on failure.
2 parents ff1c9fa + cc83761 commit 40efac0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ PHP NEWS
6060
. Fix potential buffer length truncation due to usage of type int instead
6161
of type size_t. (Girgias)
6262
. Fix memory leak when openssl polyfill returns garbage. (nielsdos)
63+
. Fix file descriptor leak in phar_zip_flush() on failure. (nielsdos)
6364

6465
- Random:
6566
. Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos)

ext/phar/zip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,7 @@ void phar_zip_flush(phar_archive_data *phar, zend_string *user_stub, bool is_def
12761276
return;
12771277
}
12781278
if (phar->alias_len != php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
1279+
php_stream_close(entry.fp);
12791280
if (error) {
12801281
spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname);
12811282
}

0 commit comments

Comments
 (0)