php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64452
Patch 64452.patch revision 2013-03-19 18:15 UTC by ab@php.net
revision 2013-03-19 18:03 UTC by ab@php.net
revision 2013-03-19 15:12 UTC by ab@php.net

Patch 64452.patch for Zip Related Bug #64452

Patch version 2013-03-19 15:12 UTC

Return to Bug #64452 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions: 2013-03-19 18:15 UTC | 2013-03-19 18:03 UTC | 2013-03-19 15:12 UTC

Developer: ab@php.net

Line 1 (now 1), was 19 lines, now 9 lines

  diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
 index 362f92d..e66c566 100644
 index 362f92d..d13134a 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)
 @@ -164,9 +164,10 @@ zip_close(struct zip *za)
       for (j=0; j<survivors; j++) {
   	i = filelist[j].idx;
   
  +	_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
 index b5b9d27..01bcb91 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


  +        free(zde->extrafield);
  +    }
       zde->extrafield = NULL;
  -    free(zde->comment);
 +    if (zde->comment_len > 0) {
 +    if (zde->comment) {
  +        free(zde->comment);
  +    }
       zde->comment = NULL;
   }
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 16:02:23 2014 UTC