Description: fix uninitialized pointer in phar_make_dirstream() Origin: upstream, http://git.php.net/?p=php-src.git;a=commit;h=e78ac461dbefb7c4a3e9fde78d50fbc56b7b0183 Origin: upstream, http://git.php.net/?p=php-src.git;a=commit;h=1ddf72180a52d247db88ea42a3e35f824a8fbda1 Origin: upstream, http://git.php.net/?p=php-src.git;a=commit;h=d7fb43e30d662c7fff999521ebf15ddbb192c7ca Bug: https://bugs.php.net/bug.php?id=70433 Index: php5-5.6.11+dfsg/ext/phar/util.c =================================================================== --- php5-5.6.11+dfsg.orig/ext/phar/util.c 2015-10-27 16:46:00.951659533 -0400 +++ php5-5.6.11+dfsg/ext/phar/util.c 2015-10-27 16:47:12.164405633 -0400 @@ -1970,7 +1970,7 @@ while ((s = zend_memrchr(filename, '/', filename_len))) { filename_len = s - filename; - if (FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len)) { + if (!filename_len || FAILURE == zend_hash_add_empty_element(&phar->virtual_dirs, filename, filename_len)) { break; } } Index: php5-5.6.11+dfsg/ext/phar/zip.c =================================================================== --- php5-5.6.11+dfsg.orig/ext/phar/zip.c 2015-07-09 20:33:32.000000000 -0400 +++ php5-5.6.11+dfsg/ext/phar/zip.c 2015-10-27 16:47:12.164405633 -0400 @@ -396,7 +396,9 @@ if (entry.filename[entry.filename_len - 1] == '/') { entry.is_dir = 1; - entry.filename_len--; + if(entry.filename_len > 1) { + entry.filename_len--; + } entry.flags |= PHAR_ENT_PERM_DEF_DIR; } else { entry.is_dir = 0;