-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 data lost on decompression #2547
fix data lost on decompression #2547
Conversation
Thanks for the patch! Could you follow DCO? |
Signed-off-by: KOMEDA Shinji <[email protected]>
4302bc3
to
12d69e7
Compare
I have failure case data, but I cannot provide because it contains privacy data. |
This script generates failure case data for string_decompress easily.
|
lib/fluent/plugin/compressable.rb
Outdated
io.pos -= adjust | ||
unless unused.nil? | ||
adjust = unused.length | ||
input.pos -= adjust |
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.
Use io
instead of input
here.
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.
Oh! It's my msitake, thank you.
Signed-off-by: KOMEDA Shinji <[email protected]>
Thanks! |
Which issue(s) this PR fixes:
Fixes #2546
in
string_decompress()
,gz.read
loop break whenunused.nil?
,but
unused.nil?
does not show end of stream.It cause data lost.
loop shoud be break when eof.