mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
FIx bug #70433 - Uninitialized pointer in phar_make_dirstream when zip entry filename is "/"
This commit is contained in:
@@ -207,7 +207,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC)
|
||||
zend_hash_internal_pointer_reset(manifest);
|
||||
|
||||
while (FAILURE != zend_hash_has_more_elements(manifest)) {
|
||||
if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) {
|
||||
if (HASH_KEY_IS_STRING != zend_hash_get_current_key_ex(manifest, &key, &keylen, &unused, 0, NULL)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Phar - bug #70433 - Uninitialized pointer in phar_make_dirstream when zip entry filename is "/"
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$phar = new PharData(__DIR__."/bug70433.zip");
|
||||
var_dump($phar);
|
||||
$meta = $phar->getMetadata();
|
||||
var_dump($meta);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
object(PharData)#1 (3) {
|
||||
["pathName":"SplFileInfo":private]=>
|
||||
string(0) ""
|
||||
["glob":"DirectoryIterator":private]=>
|
||||
bool(false)
|
||||
["subPathName":"RecursiveDirectoryIterator":private]=>
|
||||
string(0) ""
|
||||
}
|
||||
NULL
|
||||
DONE
|
||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user