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

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

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.

brotli: data at the end of content can be lost
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.
Collaborator

monnerat commented Dec 27, 2017

You're perfectly right. Many thanks for fix.

@monnerat monnerat closed this in 58d7cd2 Dec 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment