Join GitHub today
Cannot parse zip file containing 65535 files, or with a central directory offset of 0xffffffff, if not in Zip64 format #108
Create ffff.zip containing 65535 files as follows:
UnZip 6.0 can parse it:
But this yauzl program cannot:
The error message is:
yauzl interprets an
APPNOTE.TXT seems to say that the implication goes the other way: instead of 0xffff ⇒ Zip64, it is Zip64 ⇒ 0xffff; i.e., a value of 0xffff does not necessarily imply that Zip64 information must be present.
How some other implementations handle it
UnZip searches for a zip64 end of central directory locator unconditionally (whether or not there is a 0xffff or 0xffffffff), and does not error if the locator is not found. process.c:
Python zipfile also searches for a zip64 end of central directory locator unconditionally, and does not error if it does not find the expected signature:
Go archive/zip searches for a zip64 end of central directory locator only if
This issue also affects zip files that have a central directory offset of 0xffffffff. Here is a recipe to make a test case for that.
ffffffff-centralDirectoryOffset.zip.gz.gz (remove 2 layers of gzip)