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

Unable to extract zip with extra fields present in local file header #15

Closed
dasebrook opened this issue Aug 3, 2012 · 4 comments
Closed
Assignees

Comments

@dasebrook
Copy link

A ZIP containing files created with extra fields present in their local file header (such as universal time, and Unix UID/GID) cannot be properly extracted with extractEntryTo or extractAllTo methods.

I believe the fix is to replace the following line in zipFile.js:

entry.setCompressedData(buf.slice(entry.header.offset, entry.header.offset + Utils.Constants.LOCHDR + entry.header.compressedSize + entry.entryName.length));

with:

entry.setCompressedData(buf.slice(entry.header.offset, entry.header.offset + Utils.Constants.LOCHDR + entry.header.compressedSize + entry.entryName.length + buf.readUInt16LE(entry.header.offset + Utils.Constants.LOCEXT)));

@dasebrook
Copy link
Author

I believe this might also be a fix for issue 12, as the attached zip file for that issue (dexter.en.zip) contains extra fields in the local header.

@searls
Copy link

searls commented Oct 27, 2012

👍 this fixes the CRC issue for me as well.

@ghost ghost assigned cthackers Oct 28, 2012
@JoshuaGross
Copy link

@dasebrook would be helpful for you to submit a pull-request from your branch so folks (like me) could just point their repositories there

JoshuaGross added a commit to JoshuaGross/adm-zip that referenced this issue Dec 19, 2012
@cthackers
Copy link
Owner

fixed

cthackers added a commit that referenced this issue Jan 7, 2013
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

No branches or pull requests

4 participants