mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
- MFB: Fix #48763, create corrupt archive
This commit is contained in:
parent
f031901b1b
commit
38bb4c1099
1 changed files with 4 additions and 1 deletions
|
@ -175,6 +175,7 @@ zip_close(struct zip *za)
|
||||||
de.filename = strdup("-");
|
de.filename = strdup("-");
|
||||||
de.filename_len = 1;
|
de.filename_len = 1;
|
||||||
cd->entry[j].filename = "-";
|
cd->entry[j].filename = "-";
|
||||||
|
cd->entry[j].filename_len = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
de.filename = strdup(za->cdir->entry[i].filename);
|
de.filename = strdup(za->cdir->entry[i].filename);
|
||||||
|
@ -195,13 +196,15 @@ zip_close(struct zip *za)
|
||||||
error = 1;
|
error = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
|
||||||
|
|
||||||
if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
|
if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
|
||||||
de.crc = za->cdir->entry[i].crc;
|
de.crc = za->cdir->entry[i].crc;
|
||||||
de.comp_size = za->cdir->entry[i].comp_size;
|
de.comp_size = za->cdir->entry[i].comp_size;
|
||||||
de.uncomp_size = za->cdir->entry[i].uncomp_size;
|
de.uncomp_size = za->cdir->entry[i].uncomp_size;
|
||||||
de.bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
|
de.bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
|
||||||
|
cd->entry[j].bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
|
||||||
}
|
}
|
||||||
memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (za->entry[i].ch_filename) {
|
if (za->entry[i].ch_filename) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue