diff options
author | Stanislav Malyshev <stas@php.net> | 2015-09-28 21:43:16 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2015-09-28 21:43:16 -0700 |
commit | d6e8426ebf10214f750b33c37fa5df0e909b919b (patch) | |
tree | 1d01ddea92bd86aa97d53199b0ac6fb0000c94e3 | |
parent | 4c6f4863fad2a5a92cd367fb91a42afc36736ed3 (diff) | |
parent | 2e267bd3c7f4c58d577d7ba7ebe813b0fb17e4a6 (diff) | |
download | php-git-d6e8426ebf10214f750b33c37fa5df0e909b919b.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Better fix for bug #70433
Conflicts:
ext/phar/dirstream.c
ext/phar/util.c
-rw-r--r-- | ext/phar/dirstream.c | 2 | ||||
-rw-r--r-- | ext/phar/util.c | 2 | ||||
-rw-r--r-- | ext/phar/zip.c | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 1275c98d66..6cb78ad692 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -199,7 +199,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */ zend_hash_internal_pointer_reset(manifest); while (FAILURE != zend_hash_has_more_elements(manifest)) { - if (HASH_KEY_IS_STRING != zend_hash_get_current_key(manifest, &str_key, &unused)) { + if (HASH_KEY_NON_EXISTENT == zend_hash_get_current_key(manifest, &str_key, &unused)) { break; } diff --git a/ext/phar/util.c b/ext/phar/util.c index f2f422ef62..8da8ecc57d 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1929,7 +1929,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename while ((s = zend_memrchr(filename, '/', filename_len))) { filename_len = s - filename; - if (NULL == zend_hash_str_add_empty_element(&phar->virtual_dirs, filename, filename_len)) { + if (!filename_len || NULL == zend_hash_str_add_empty_element(&phar->virtual_dirs, filename, filename_len)) { break; } } diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 7421a89de3..bf85437808 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -384,7 +384,9 @@ foundit: 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; |