mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed bug #64452 Zip PHPTs crash intermittently
This commit is contained in:
commit
06a526be3e
2 changed files with 14 additions and 4 deletions
|
@ -88,6 +88,9 @@ zip_close(struct zip *za)
|
||||||
if (za == NULL)
|
if (za == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (za->zp == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (!_zip_changed(za, &survivors)) {
|
if (!_zip_changed(za, &survivors)) {
|
||||||
_zip_free(za);
|
_zip_free(za);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -164,9 +167,10 @@ zip_close(struct zip *za)
|
||||||
for (j=0; j<survivors; j++) {
|
for (j=0; j<survivors; j++) {
|
||||||
i = filelist[j].idx;
|
i = filelist[j].idx;
|
||||||
|
|
||||||
|
_zip_dirent_init(&de);
|
||||||
|
|
||||||
/* create new local directory entry */
|
/* create new local directory entry */
|
||||||
if (ZIP_ENTRY_DATA_CHANGED(za->entry+i) || new_torrentzip) {
|
if (ZIP_ENTRY_DATA_CHANGED(za->entry+i) || new_torrentzip) {
|
||||||
_zip_dirent_init(&de);
|
|
||||||
|
|
||||||
if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
|
if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
|
||||||
_zip_dirent_torrent_normalize(&de);
|
_zip_dirent_torrent_normalize(&de);
|
||||||
|
|
|
@ -157,11 +157,17 @@ _zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error)
|
||||||
void
|
void
|
||||||
_zip_dirent_finalize(struct zip_dirent *zde)
|
_zip_dirent_finalize(struct zip_dirent *zde)
|
||||||
{
|
{
|
||||||
|
if (zde->filename_len > 0) {
|
||||||
free(zde->filename);
|
free(zde->filename);
|
||||||
|
}
|
||||||
zde->filename = NULL;
|
zde->filename = NULL;
|
||||||
|
if (zde->extrafield_len > 0) {
|
||||||
free(zde->extrafield);
|
free(zde->extrafield);
|
||||||
|
}
|
||||||
zde->extrafield = NULL;
|
zde->extrafield = NULL;
|
||||||
|
if (zde->comment_len > 0) {
|
||||||
free(zde->comment);
|
free(zde->comment);
|
||||||
|
}
|
||||||
zde->comment = NULL;
|
zde->comment = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue