mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
new test for truncated manifest
This commit is contained in:
parent
68a5fdea12
commit
f86df41ff4
19
ext/phar/tests/008.phpt
Normal file
19
ext/phar/tests/008.phpt
Normal file
@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
PHP_Archive::mapPhar improper parameters
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) print "skip";?>
|
||||
--FILE--
|
||||
<?php
|
||||
function cleanup() { unlink(dirname(__FILE__) . '/008_phar.php'); }
|
||||
register_shutdown_function('cleanup');
|
||||
$file = "<?php
|
||||
PHP_Archive::mapPhar(5, 'hio', false);
|
||||
__HALT_COMPILER(); ?>";
|
||||
$file .= pack('V', 500) . 'notenough';
|
||||
file_put_contents(dirname(__FILE__) . '/008_phar.php', $file);
|
||||
include dirname(__FILE__) . '/008_phar.php';
|
||||
exit;
|
||||
PHP_Archive::mapPhar(5, 'hio', false);
|
||||
__HALT_COMPILER(); ?>
|
||||
--EXPECTF--
|
||||
Fatal error: PHP_Archive::mapPhar(): internal corruption of phar "%s" (truncated manifest) in %s on line %d
|
Loading…
Reference in New Issue
Block a user