bug46032.phpt 753 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Phar: bug #46032: PharData::__construct wrong memory read
  3. --EXTENSIONS--
  4. phar
  5. --SKIPIF--
  6. <?php if (getenv('SKIP_SLOW_TESTS')) die('skip'); ?>
  7. --FILE--
  8. <?php
  9. $a = __DIR__ .'/mytest';
  10. try {
  11. new phar($a);
  12. } catch (exception $e) { }
  13. var_dump($a);
  14. try {
  15. new phar($a);
  16. } catch (exception $e) { }
  17. var_dump($a);
  18. new phardata('0000000000000000000');
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. string(%d) "%smytest"
  23. string(%d) "%smytest"
  24. Fatal error: Uncaught UnexpectedValueException: Cannot create phar '0000000000000000000', file extension (or combination) not recognised or the directory does not exist in %sbug46032.php:%d
  25. Stack trace:
  26. #0 %sbug46032.php(%d): PharData->__construct('000000000000000...')
  27. #1 {main}
  28. thrown in %sbug46032.php on line %d