summaryrefslogtreecommitdiff
path: root/ext/phar/tar.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-04-29 22:04:20 -0700
committerStanislav Malyshev <stas@php.net>2015-04-29 22:51:43 -0700
commitc27f012b7a447e59d4a704688971cbfa7dddaa74 (patch)
tree7d4d6a70e99cbcafd79d36e6a7dacf44ee616fa7 /ext/phar/tar.c
parentac2832935435556dc593784cd0087b5e576bbe4d (diff)
downloadphp-git-c27f012b7a447e59d4a704688971cbfa7dddaa74.tar.gz
Fix bug #69453 - don't try to cut empty string
Diffstat (limited to 'ext/phar/tar.c')
-rw-r--r--ext/phar/tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index ca8eafcc8a..d6d63e6599 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -425,7 +425,7 @@ bail:
entry.filename_len = i;
entry.filename = pestrndup(hdr->name, i, myphar->is_persistent);
- if (entry.filename[entry.filename_len - 1] == '/') {
+ if (i > 0 && entry.filename[entry.filename_len - 1] == '/') {
/* some tar programs store directories with trailing slash */
entry.filename[entry.filename_len - 1] = '\0';
entry.filename_len--;