-
Notifications
You must be signed in to change notification settings - Fork 4
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 large file decompression bug #40
Fix large file decompression bug #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing this to my attention!
On another library where I work on, pyton-isal, the ISA-L struct uses a uint32_t integer by design. I didn't properly check if this was the case for zlib-ng. My bad.
I have some minor comments. If you could address these I will make a new release ASAP.
Thanks a lot for your comments! Updated the PR accordingly. |
Release binaries are being build now. Thanks a lot for the fix! |
Checklist
The ISIZE field is specified to hold the size the original (uncompressed) file modulo 2^32 (since there are only 32 bits available for this field). This means that when a file larger than 4GB is compressed,
ISIZE
does not actually hold the file size. However, when handling the gzip trailer, the code compares the total output size with theISIZE
field directly (without truncating higher order bits), which only works ifsize_t
(as the data type that is used to hold thetotal_out
variable) is also 32 bits long, which is not the case in general.