zlib icon indicating copy to clipboard operation
zlib copied to clipboard

Reading "disk number start"

Open kalibera opened this issue 3 years ago • 1 comments

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.

kalibera avatar Sep 01 '22 12:09 kalibera

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

madler avatar Oct 06 '22 22:10 madler

you are right, unz64local_getShort is used to fill disk_num_start

gvollant avatar Jul 29 '23 08:07 gvollant

Applied fix.

madler avatar Jul 30 '23 06:07 madler

Applied fix manually. (Due to indentation issues.)

madler avatar Jul 30 '23 06:07 madler