1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Files
archived-php-src/ext/phar/tests/bug72321.phpt
Nikita Popov ddc21b0902 Fix phar test
As the REPORT_ERRORS flag is now respected, this no longer
throws a warning (in addition to the exception).
2021-08-17 14:57:17 +02:00

26 lines
785 B
PHP

--TEST--
Phar: PHP bug #72321: invalid free in phar_extract_file()
--EXTENSIONS--
phar
--FILE--
<?php
chdir(__DIR__);
mkdir("test72321");
$phar = new PharData("72321_1.zip");
$phar->extractTo("test72321");
$phar = new PharData("72321_2.zip");
try {
$phar->extractTo("test72321");
} catch(PharException $e) {
print $e->getMessage()."\n";
}
?>
DONE
--CLEAN--
<?php unlink(__DIR__."/test72321/AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
rmdir(__DIR__."/test72321");
?>
--EXPECTF--
Extraction from phar "%s72321_2.zip" failed: Cannot extract "AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b/c", could not create directory "test72321/AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b"
DONE