Skip to content

Commit

Permalink
Merge pull request #460 from gdubois/issue_457_fix
Browse files Browse the repository at this point in the history
ZIP64 files containing more than 65,535 entries only report 65,535 en…
  • Loading branch information
nmoinvaz authored Mar 22, 2020
2 parents f2843c2 + 3b3961e commit d791510
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mz_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ static int32_t mz_zip_read_cd(void *handle)
{
mz_zip *zip = (mz_zip *)handle;
uint64_t number_entry_cd64 = 0;
uint64_t number_entry = 0;
uint64_t number_entry_cd = 0;
int64_t eocd_pos = 0;
int64_t eocd_pos64 = 0;
Expand Down Expand Up @@ -1052,12 +1051,12 @@ static int32_t mz_zip_read_cd(void *handle)
err = mz_stream_read_uint32(zip->stream, &zip->disk_number_with_cd);
/* Total number of entries in the central directory on this disk */
if (err == MZ_OK)
err = mz_stream_read_uint64(zip->stream, &number_entry);
err = mz_stream_read_uint64(zip->stream, &zip->number_entry);
/* Total number of entries in the central directory */
if (err == MZ_OK)
err = mz_stream_read_uint64(zip->stream, &number_entry_cd64);
if (number_entry == UINT32_MAX)
zip->number_entry = number_entry_cd64;
if (zip->number_entry != number_entry_cd64)
err = MZ_FORMAT_ERROR;
/* Size of the central directory */
if (err == MZ_OK)
{
Expand Down

0 comments on commit d791510

Please sign in to comment.