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

brotli: data at the end of content can be lost #2194

Closed
wants to merge 1 commit into from
Closed

brotli: data at the end of content can be lost #2194

wants to merge 1 commit into from

Conversation

3dyd
Copy link
Contributor

@3dyd 3dyd commented Dec 25, 2017

Decoding loop implementation did not concern the case when all received data is consumed by Brotli decoder and the size of decoded data, internally hold by Brotli decoder, is greater than CURL_MAX_WRITE_SIZE value. For content with not encoded length greater than CURL_MAX_WRITE_SIZE this can result in the loss of data at the end of content.


I am not sure if the test for bug fix is welcome. It is also tied to CURL_MAX_WRITE_SIZE being set to 16384 and makes no sense if this value is greater.

Decoding loop implementation did not concern the case when all received data is consumed by Brotli decoder and the size of decoded data, internally hold by Brotli decoder, is greater than CURL_MAX_WRITE_SIZE value. For content with not encoded length greater than CURL_MAX_WRITE_SIZE this can result in the loss of data at the end of content.
@monnerat
Copy link
Contributor

You're perfectly right. Many thanks for fix.

@monnerat monnerat closed this in 58d7cd2 Dec 27, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants