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 memleak+UAF when opening temp stream in buildFromDirectory() fails
This commit is contained in:
2
NEWS
2
NEWS
@@ -33,6 +33,8 @@ PHP NEWS
|
||||
. Fix a bunch of memory leaks in phar_parse_zipfile() error handling.
|
||||
(nielsdos)
|
||||
. Fix file descriptor/memory leak when opening central fp fails. (nielsdos)
|
||||
. Fix memleak+UAF when opening temp stream in buildFromDirectory() fails.
|
||||
(nielsdos)
|
||||
|
||||
- Random:
|
||||
. Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos)
|
||||
|
||||
@@ -1792,6 +1792,10 @@ PHP_METHOD(Phar, buildFromDirectory)
|
||||
pass.ret = return_value;
|
||||
pass.fp = php_stream_fopen_tmpfile();
|
||||
if (pass.fp == NULL) {
|
||||
zval_ptr_dtor(&iteriter);
|
||||
if (apply_reg) {
|
||||
zval_ptr_dtor(®exiter);
|
||||
}
|
||||
zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user