zlib-ng / minizip-ng

Fork of the popular zip manipulation library found in the zlib distribution.
Other
1.25k stars 434 forks source link

mz_zip_entry_needs_zip64 always sets zip64 to 1 because uncompressed_size is always 0 #805

Closed Coeur closed 4 weeks ago

Coeur commented 4 weeks ago

Since minizip-ng 2.10.6, with ef93d65a5d3b6698003f2119542f7ef4535cde69, we have this new logic:

https://github.com/zlib-ng/minizip-ng/blob/b2691a0c96303c1fee5dbd4b8008e3dedec3b613/mz_zip.c#L576-L583

The problem is that uncompressed_size is always 0 when we reach this part of the code, so zip64 always becomes 1 when using MZ_ZIP64_AUTO.

nmoinvaz commented 4 weeks ago

I think you either have to disable zip64 or specify the uncompressed size in file_info right?

Coeur commented 4 weeks ago

Ah, my bad, you're right. Let me try to specify it.

Coeur commented 4 weeks ago

Although, none of zipOpenNewFile* methods have a parameter for the filesize, effectively breaking MZ_ZIP64_AUTO for any legacy api.

nmoinvaz commented 4 weeks ago

Sorry for the breaking changes. I didn't realize it would have an impact. I think it is the difference between zip64 for local file header vs central directory header.