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

Fix for clients failing on just having a 64 bit offset in ZIP64 #453

Merged
merged 1 commit into from
May 24, 2019

Conversation

Lssikkes
Copy link
Contributor

Sorry Adam, while testing some bigger ZIP64 files I found a case where some archive tools don't accept having just 0xFFFFFFFF only for relative offset. This should fix that by also forcing it for compressed/decompressed size to make sure they read everything from the ZIP64 directory record when anything goes over uint32 max for that specific entry.

(according to the spec it's allowed - so technically the commit before was not wrong, but it's probably better to be on the safe side:
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
4.4.16 relative offset of local header: (4 bytes)

   This is the offset from the start of the first disk on
   which this file appears, to where the local header SHOULD
   be found.  If an archive is in ZIP64 format and the value
   in this field is 0xFFFFFFFF, the size will be in the 
   corresponding 8 byte zip64 extended information extra field.)

image

image

…eaders are only pointed to in ZIP64 directory structure
@Lssikkes
Copy link
Contributor Author

Just checked the ZipReader and it seems SharpCompress actually does the right thing, so no need for changes there..

@adamhathcock
Copy link
Owner

Thanks again

@adamhathcock adamhathcock merged commit ffea093 into adamhathcock:master May 24, 2019
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 this pull request may close these issues.

2 participants