mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
crash inside brotli::BrotliCompressor::WriteBrotliData() #106
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nitram509 on GitHub (May 16, 2016).
Abstract
When doing compression, using the WriteBrotliData() 3-times in a row, the program will crash.
Hint:
the argument for 'is_last' is always 'true'. Setting this argument to false, will "fix" this crash.
Expected behavior
Even if I use is_last=true multiple times, I expect no crashes.
Instances of BrotliCompressor should maintain a "safe" internal state
and should not crash.
Example program, which crashes:
https://gist.github.com/nitram509/081b5826e173910eba20097cba9dde8c
Environment
The program crashes on these environments
The program will NOT crash on OSX, even when doing 100x WriteBrotliData().
Background information
I'm the author of jbrotli (Java bindings for (lib-)brotli).
A user of jbrotli filled an issue and it seems to me, there is a bug inside brotli itself.
So I wrote a minimal C-program to demonstrate, what's going on inside the Java-program.
@eustas commented on GitHub (May 17, 2016):
Hello.
Thank you for your report. Going to fix problem ASAP.
Meanwhile we're preparing update to encoder that will bring more clear C streaming API.
Best regards,
Eugene.
@nitram509 commented on GitHub (May 17, 2016):
👍