Test: /ext/phar/tests/bug69958.phpt - Version 5.5.28-dev        

Security #69958 Segfault in Phar::convertToData on invalid file
Submitted: 2015-06-29 01:47:48 Modified: 2015-08-09 08:51:12
From: stas Assigned: kaplan
Status: Closed Package: Reproducible crash
PHP Version: master-Git-2015-06-29 (Git) OS:

There are 2 different diffs reported by users for this test.

Count Diff
1 (50%)
006+ /home/travis/build/smalyshev/php-src/main/streams/streams.c(530) : Stream of type 'STDIO' 0x7feee92c4e30 (path:/tmp/phpxdaBiw) was not closed
007+ /home/travis/build/smalyshev/php-src/main/streams/streams.c(530) : Stream of type 'STDIO' 0x7feee92bf498 (path:/home/travis/build/smalyshev/php-src/ext/phar/tests/bug69958.tar) was not closed
1 (50%)
001+ /home/travis/build/smalyshev/php-src/Zend/zend_hash.c(551) : ht=0x7f3a0eeecad8 is inconsistent
002+ [Tue Jul 7 05:10:43 2015] Script: %s/bug69958.php'
003+ ---------------------------------------
004+ /home/travis/build/smalyshev/php-src/Zend/zend_execute.h(81) : Block 0x7f3a0eee79e8 status:
005+ /home/travis/build/smalyshev/php-src/Zend/zend_variables.c(36) : Actual location (location was relayed)
001- Fatal error: Uncaught exception 'BadMethodCallException' with message 'phar "%s/bug69958.tar" exists and must be unlinked prior to conversion' in %s/bug69958.php:%d
002- Stack trace:
003- #0 %s/bug69958.php(%d): PharData->convertToData(%d)
004- #1 {main}
005- thrown in %s/bug69958.php on line %d
006+ Beginning: Cached
007+ Freed (invalid)
008+ Start: OK
009+ End: OK
010+ ---------------------------------------
011+
012+ Warning: String is not zero-terminated (ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ+�) (source: /home/travis/build/smalyshev/php-src/Zend/zend_execute.h:81) in Unknown on line 0
013+ /home/travis/build/smalyshev/php-src/main/streams/streams.c(530) : Stream of type 'STDIO' 0x7f3a0eee7498 (path:/home/travis/build/smalyshev/php-src/ext/phar/tests/bug69958.tar) was not closed