mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
phar: Fix file descriptor leak in phar_zip_flush() on failure.
Closes GH-20228.
This commit is contained in:
1
NEWS
1
NEWS
@@ -56,6 +56,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)
|
||||
|
||||
@@ -1246,6 +1246,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
|
||||
return EOF;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user