|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch 64452.patch for Zip Related Bug #64452Patch version 2013-03-19 18:03 UTC Return to Bug #64452 | Download this patchThis patch is obsolete Obsoleted by patches: This patch renders other patches obsolete Obsolete patches: Patch Revisions:
Developer: ab@php.net
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
index 362f92d..d13134a 100644
--- a/ext/zip/lib/zip_close.c
+++ b/ext/zip/lib/zip_close.c
@@ -164,9 +164,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);
diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c
index b5b9d27..b9dac5c 100644
--- a/ext/zip/lib/zip_dirent.c
+++ b/ext/zip/lib/zip_dirent.c
@@ -157,11 +157,17 @@ _zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error)
void
_zip_dirent_finalize(struct zip_dirent *zde)
{
- free(zde->filename);
+ if (zde->filename_len > 0) {
+ free(zde->filename);
+ }
zde->filename = NULL;
- free(zde->extrafield);
+ if (zde->extrafield_len > 0) {
+ free(zde->extrafield);
+ }
zde->extrafield = NULL;
- free(zde->comment);
+ if (zde->comment_len > 0) {
+ free(zde->comment);
+ }
zde->comment = NULL;
}
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |