summaryrefslogtreecommitdiff
path: root/ext/phar/zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/phar/zip.c')
-rw-r--r--ext/phar/zip.c4
1 files changed, 3 insertions, 1 deletions
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;