com php-src: other fix for #64214, unmodified file may not have old fp set, causing other possible crashes: ext/phar/zip.c
| From: | Pierre Joye | Date: | Fri, 17 May 2013 09:45:13 +0000 |
| Subject: | com php-src: other fix for #64214, unmodified file may not have old fp set, causing other possible crashes: ext/phar/zip.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72198@lists.php.net to get a copy of this message | ||
Commit: 3eb1745643e6774dcd589705bf566516561d1cff
Author: Pierre Joye <pierre.php@gmail.com> Fri, 17 May 2013 11:45:13 +0200
Parents: 86db5fb4c2b7199dc862dfce99c345c49305ba8a
Branches: PHP-5.3 PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3eb1745643e6774dcd589705bf566516561d1cff
Log:
other fix for #64214, unmodified file may not have old fp set, causing other possible crashes
Bugs:
https://bugs.php.net/64214
Changed paths:
M ext/phar/zip.c
Diff:
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index c8057e3..6ba745e 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: