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 GZip Reader and Writer to handle large data sizes #8421

Merged
merged 1 commit into from
Nov 2, 2019

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Nov 1, 2019

In the gzip format isize is 4 bytes wide and contains the size of the original (uncompressed) input
data modulo 2^32. So sizes can be larger than UInt32::MAX but the addition must wrap, not overflow. See https://tools.ietf.org/html/rfc1952#page-8

Fixes #8418

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib labels Nov 1, 2019
@asterite asterite added this to the 0.32.0 milestone Nov 2, 2019
@asterite asterite merged commit f621a5a into crystal-lang:master Nov 2, 2019
@straight-shoota straight-shoota deleted the fix/gzip-large-isize branch November 2, 2019 00:47
@rvictory
Copy link

rvictory commented Nov 2, 2019

I can confirm that this code (manually applied in my environment) fixes my issue (#8418). Amazing work guys, this just confirms that this language is the one I want!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GZip IO Fails on Very Large gzip Files
4 participants