Annotation of embedaddon/php/ext/phar/tests/bug46032.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Phar: bug #46032: PharData::__construct wrong memory read
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("phar")) die("skip"); ?>
! 5: <?php if (getenv('SKIP_SLOW_TESTS')) die('skip'); ?>
! 6: --FILE--
! 7: <?php
! 8:
! 9: $a = dirname(__FILE__) .'/mytest';
! 10:
! 11: try {
! 12: new phar($a);
! 13: } catch (exception $e) { }
! 14:
! 15: var_dump($a);
! 16:
! 17: try {
! 18: new phar($a);
! 19: } catch (exception $e) { }
! 20:
! 21: var_dump($a);
! 22:
! 23: new phardata('0000000000000000000');
! 24: ?>
! 25: ===DONE===
! 26: --EXPECTF--
! 27: %string|unicode%(%d) "%smytest"
! 28: %string|unicode%(%d) "%smytest"
! 29:
! 30: Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '0000000000000000000', file extension (or combination) not recognised or the directory does not exist' in %sbug46032.php:%d
! 31: Stack trace:
! 32: #0 %sbug46032.php(%d): PharData->__construct('000000000000000...')
! 33: #1 {main}
! 34: thrown in %sbug46032.php on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>