summaryrefslogtreecommitdiff
path: root/ext/zip/lib/zip_close.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2013-03-20 09:14:13 +0100
committerAnatol Belski <ab@php.net>2013-03-20 09:14:13 +0100
commit0125ec77d21fa585206617fc593da3ebce74304a (patch)
tree03bd5332633ed68cec2d51a120f2d262c9b58df4 /ext/zip/lib/zip_close.c
parent5aaff8d634ec919a5fa24c05485b5ad250588982 (diff)
parent0881ff046686197984013e3ca3d84a797144ffcd (diff)
downloadphp-git-0125ec77d21fa585206617fc593da3ebce74304a.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: updated NEWS Fixed bug #64452 Zip PHPTs crash intermittently
Diffstat (limited to 'ext/zip/lib/zip_close.c')
-rw-r--r--ext/zip/lib/zip_close.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
index 362f92d749..e66c56697b 100644
--- a/ext/zip/lib/zip_close.c
+++ b/ext/zip/lib/zip_close.c
@@ -88,6 +88,9 @@ zip_close(struct zip *za)
if (za == NULL)
return -1;
+ if (za->zp == NULL)
+ return -1;
+
if (!_zip_changed(za, &survivors)) {
_zip_free(za);
return 0;
@@ -164,9 +167,10 @@ zip_close(struct zip *za)
for (j=0; j<survivors; j++) {
i = filelist[j].idx;
+ _zip_dirent_init(&de);
+
/* create new local directory entry */
if (ZIP_ENTRY_DATA_CHANGED(za->entry+i) || new_torrentzip) {
- _zip_dirent_init(&de);
if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
_zip_dirent_torrent_normalize(&de);