summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2013-05-17 11:49:33 +0200
committerPierre Joye <pierre.php@gmail.com>2013-05-17 11:49:33 +0200
commitaff65a03461ad552ce9eb769d390285a9bcd9099 (patch)
treeb4ab922bbba2028928e2be8480d8a241b997b001
parent09470ebf35a47ac34c3ffa5524ccb47ff404cd5a (diff)
parent46b05bc57aee7a24f87a31a079f9076f4870b780 (diff)
downloadphp-git-aff65a03461ad552ce9eb769d390285a9bcd9099.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: entry for #64214 other fix for #64214, unmodified file may not have old fp set, causing other possible crashes
-rw-r--r--ext/phar/zip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index c8057e3bbe..6ba745e9cb 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -937,10 +937,11 @@ is_compressed:
PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize);
PHAR_SET_32(central.compsize, entry->compressed_filesize);
PHAR_SET_32(local.compsize, entry->compressed_filesize);
-
- if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) {
- spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
- return ZEND_HASH_APPLY_STOP;
+ if (p->old) {
+ if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) {
+ spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
+ return ZEND_HASH_APPLY_STOP;
+ }
}
}
not_compressed: