Skip to content

Problem reading archives containg Zip64 files #735

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

Closed
andrea-parisi opened this issue Mar 23, 2022 · 1 comment · Fixed by #736
Closed

Problem reading archives containg Zip64 files #735

andrea-parisi opened this issue Mar 23, 2022 · 1 comment · Fixed by #736

Comments

@andrea-parisi
Copy link

Steps to reproduce

  1. Create a ZipFile using on iOS with password for example
    Moduli.zip (Password DEDALUS)
  2. Extract the previous file

Expected behavior

Extract the contained file

Actual behavior

Throw ZipException "Size invalid for descriptor"

Version of SharpZipLib

1.3.3 but also verified against master

Obtained from (only keep the relevant lines)

  • Compiled from source
  • Package installed using NuGet 1.3.3

I think that the condition size != -1 in the method TestLocalHeader is wrong. but must be size > 0. In my case the value of size is 0 and also compressedSize value is 0.

@piksel
Copy link
Member

piksel commented Mar 23, 2022

Hm, yeah, I think you are right. The correct local header value for an entry with a descriptor ought to be 0, not -1. The only mention of -1 (or rather "all bits set", 0xFFFFFFFF) is for the Zip64 indicator.
https://p1k.se/appnote.md#s439-data-descriptor

The question is, why has this not been a problem for other files? There might be a "de facto" standard of putting -1 in the field, or it's just that the combination of reading an archive with Zip64 and descriptors using ZipFile is rare enough for this not to have been a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants