Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip: omit Disk Start Number from the Zip64 Central Directory Entry #6

Merged
merged 1 commit into from
Mar 13, 2024

Commits on Mar 13, 2024

  1. Zip: omit Disk Start Number from the Zip64 Central Directory Entry

    Clause 4.5.3 of the PKWare spec clearly states that it MUST only appear in
    the Extra block when the corresponding field in the CDE (or LDE) was set to
    -1 (0xFFFF in the case of the Disk Start Number.)
    
    Previously, this would only be the case when Zip64 was presumed or the disk
    number was actually outside the range for the CDE. In every other case, the
    Disk Start Number would go into both locations, violating the spec.
    
    Some tools (such as 7-Zip) show warnings in this case, but often work as
    expected. Others (such as older versions of System.IO.Compression) follow
    the spec more stringently and will refuse to use the values from the Zip64
    Extra block when the related values do not match their expectation.
    
    However, fixing this to always write a conformant CDE that has its Disk
    Start Number as 0xFFFF with the actual value in the Extra block breaks other
    tools (such as marmelroy/Zip on iOS) that do not fully support Zip64.
    
    The spec does allow the Extra block to omit the Disk Start Number (and the
    Relativ Header Offset) when they fit in the CDE, so we do just that for
    general compatibility.
    
    Fixes haf#260
    BhaaLseN authored and René Mihula committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    5ce3732 View commit details
    Browse the repository at this point in the history