From 3eb1745643e6774dcd589705bf566516561d1cff Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Fri, 17 May 2013 11:45:13 +0200 Subject: other fix for #64214, unmodified file may not have old fp set, causing other possible crashes --- ext/phar/zip.c | 9 +++++---- 1 file 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: -- cgit v1.2.1 From 46b05bc57aee7a24f87a31a079f9076f4870b780 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Fri, 17 May 2013 11:49:13 +0200 Subject: entry for #64214 --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index eae701eba1..ce86bb2f58 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,10 @@ PHP NEWS . Fixed bug #64821 (Custom Exception crash when internal properties overridden). (Anatol) +- Phar + . Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or with + non std tmp dir). (Pierre) + 09 May 2013, PHP 5.3.25 - Core: -- cgit v1.2.1