xref: /php-src/ext/phar/tests/bug69453.phpt (revision 74859783)
1--TEST--
2Phar: bug #69453: Memory Corruption in phar_parse_tarfile when entry filename starts with null
3--EXTENSIONS--
4phar
5--FILE--
6<?php
7$fname = __DIR__ . '/bug69453.tar.phar';
8try {
9$r = new Phar($fname, 0);
10} catch(UnexpectedValueException $e) {
11    echo $e;
12}
13?>
14--EXPECTF--
15UnexpectedValueException: phar error: "%s%ebug69453.tar.phar" is a corrupted tar file (checksum mismatch of file "") in %s:%d
16Stack trace:
17#0 %s%ebug69453.php(%d): Phar->__construct('%s', 0)
18#1 {main}
19