Skip to content

Commit

Permalink
do not jump over initialisation (kuba--#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
prissi authored and thabetx committed Sep 7, 2023
1 parent 61bee7d commit 0043fdd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,8 @@ int zip_entry_close(struct zip_t *zip) {
mz_uint8 *pExtra_data = NULL;
mz_uint32 extra_size = 0;
mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;

if (!zip) {
// zip_t handler is not initialized
Expand Down Expand Up @@ -1185,9 +1187,6 @@ int zip_entry_close(struct zip_t *zip) {
mz_zip_time_t_to_dos_time(zip->entry.m_time, &dos_time, &dos_date);
#endif

mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;

MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID);
MZ_WRITE_LE32(local_dir_footer + 4, zip->entry.uncomp_crc32);
MZ_WRITE_LE64(local_dir_footer + 8, zip->entry.comp_size);
Expand Down

0 comments on commit 0043fdd

Please sign in to comment.