1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Files
Su, Tao edae24313d Fix GH-10755: Memory leak in phar_rename_archive()
In phar_renmae_archive() context, added one reference but immediately
destroyed another, so do not need to increase refcount. With removal of
refcount++ line, PHP/Zend no longer reports memory leak.
Updated bug69958.phpt test file accordingly.

Closes GH-10856
2023-03-20 13:27:33 +01:00

16 lines
468 B
PHP

--TEST--
Phar: bug #69958: Segfault in Phar::convertToData on invalid file
--EXTENSIONS--
phar
--FILE--
<?php
$tarphar = new PharData(__DIR__.'/bug69958.tar');
$phar = $tarphar->convertToData(Phar::TAR);
?>
--EXPECTF--
Fatal error: Uncaught BadMethodCallException: phar "%sbug69958.tar" exists and must be unlinked prior to conversion in %sbug69958.php:%d
Stack trace:
#0 %sbug69958.php(%d): PharData->convertToData(%d)
#1 {main}
thrown in %sbug69958.php on line %d