Closed VivekPanyam closed 10 months ago
This is more or less the read
version of the write
related issues #105 & https://github.com/Majored/rs-async-zip/pull/106 so I guess there needs to be more fixed regarding Zip64 and the CD / local header parsing / creation.
The code that parses the zip64 extended information field checks that the field is long enough to contain both the compressed and uncompressed size of the entry.
https://github.com/Majored/rs-async-zip/blob/802c96192d958fd699018cefc0e58058ef8b7694/src/spec/extra_field.rs#L102-L126
For parsing local file headers, this is correct because both the compressed and uncompressed size are required to be present.
However, according to the ZIP spec, the zip64 extended field in the central directory is not always required to contain compressed and uncompressed size (see below).
This leads to failures when parsing valid zip64 files.
Relevant section of the spec:
Note that it says "This entry in the Local header MUST include BOTH original and compressed file size fields" otherwise they "MUST only appear if the corresponding Local or Central directory record field is set to 0xFFFF or 0xFFFFFFFF." (emphasis mine)