madler / zlib

A massively spiffy yet delicately unobtrusive compression library.
http://zlib.net/
Other
5.69k stars 2.45k forks source link

Reading "disk number start" #699

Closed kalibera closed 1 year ago

kalibera commented 2 years ago

Minizip reads the disk number start from the zip64 extended information extra field, when the value of disk_num_start is 0xffffffff (MAXU32). However, the specification seems to be saying that one should read from the extra field when the value is 0xffff (4.4.13). Is my reading of the specification correct?

https://github.com/madler/zlib/blob/21767c654d31d2dccdde4330529775c6c5fd5389/contrib/minizip/unzip.c#L1062 https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

I don't have any use case/archive for this, just came across this possible inconsistency in the code while analyzing a bug report.

madler commented 2 years ago

You are correct. I will leave it to @gvollant to suggest a fix.

gvollant commented 1 year ago

you are right, unz64local_getShort is used to fill disk_num_start

madler commented 1 year ago

Applied fix.

madler commented 1 year ago

Applied fix manually. (Due to indentation issues.)