Skip to content

fixed wrong headers for decompression #758

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

Merged
merged 1 commit into from
Sep 2, 2012
Merged

fixed wrong headers for decompression #758

merged 1 commit into from
Sep 2, 2012

Conversation

Dav1dde
Copy link
Contributor

@Dav1dde Dav1dde commented Aug 25, 2012

In some archives the headers for each indivdual ArchivMember are incomplete.
And these incomplete headers would overwrite the actual headers with 0 which
results in a ZlibException (since compressedSize and expandedSize are 0).

In some archives the headers for each indivdual `ArchivMember` are incomplete.
And these incomplete headers would overwrite the actual headers with `0` which
results in a `ZlibException` (since `compressedSize` and `expandedSize` are `0`)
@Wallbraker
Copy link

Should probably be applied to D1 Phobos as well.

Cheers, Jakob.

@Dav1dde
Copy link
Contributor Author

Dav1dde commented Aug 25, 2012

For D1 Branch: #759

@braddr
Copy link
Member

braddr commented Aug 25, 2012

The fix doesn't match the problem description. I expected to see if (field == 0) doSomething. Did this fix come from some other zip implementation or a best guess at the right way to handle it? Do you have a sample .zip that illustrates this behavior? Please construct a unit test that validates the before and after behavior.

@Dav1dde
Copy link
Contributor Author

Dav1dde commented Aug 25, 2012

Example zip, every minecraft release after 1.2.5 (availabe from: http://www.mojang.com/ – the minecraft.jar). @Wallbraker has a D1 zip-implementation, he was able to load the minecraft.jar, so I debugged std.zip step by step, to see what's wrong. I found out that de.compressedSize was overwritten with 0, which caused zlib to error with buf error.

andralex added a commit that referenced this pull request Sep 2, 2012
fixed wrong headers for decompression
@andralex andralex merged commit 4596ab6 into dlang:master Sep 2, 2012
@andralex
Copy link
Member

andralex commented Sep 2, 2012

merged, thanks

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.

4 participants