summaryrefslogtreecommitdiff
path: root/ext/phar/util.c
diff options
context:
space:
mode:
authorSteph Fox <sfox@php.net>2008-05-24 14:18:31 +0000
committerSteph Fox <sfox@php.net>2008-05-24 14:18:31 +0000
commit76a9ec377b1878993daf5e116b32d256cc11f54d (patch)
tree48a3e4b5f352c4e5356e65638eb7a0907aedc1ab /ext/phar/util.c
parent7efb792fe829b31fd62d539b4544078f95a6b7d7 (diff)
downloadphp-git-76a9ec377b1878993daf5e116b32d256cc11f54d.tar.gz
- MFB major fixes
* found felipe's segfault in util.c and fixed the segfault (3 tests fail due to odd behavior of . and .. on this machine) * fixed serious flaws in the setting/resetting of is_data - now it works properly. Assume all new PharData are tar-based, and allow passing Phar::ZIP to PharData constructor to override this * fix broken earlier commit, introduced segfault that broke 20 tests here
Diffstat (limited to 'ext/phar/util.c')
-rw-r--r--ext/phar/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/phar/util.c b/ext/phar/util.c
index bc6ccaaa78..0099928f8b 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -1171,9 +1171,14 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in
if (!phar->manifest.arBuckets) {
return NULL;
}
+
if (is_dir) {
+ if (!path_len || path_len == 1) {
+ return NULL;
+ }
path_len--;
}
+
if (SUCCESS == zend_hash_find(&phar->manifest, path, path_len, (void**)&entry)) {
if (entry->is_deleted) {
/* entry is deleted, but has not been flushed to disk yet */