Closed horu closed 1 year ago
Hi! Thanks, I'll take a look at it a bit later today.
@horu, may I ask, have you encountered a case of infinite loop during decompression in the wild?
We have got infinite loop for our high load service when it receives invalid post requests. We have no examples now but we had some.
Thanks for your PR. I'm working on the update for RESTinio and hope to release a version with the fix in a couple of days.
Hi. zlib doc says inflate returns Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced (https://github.com/madler/zlib/blob/master/zlib.h#L503). It means we can finish decompressing and break the loop even we still have input data ( avail_in is not zero ). In other case we get infinite loop when decompressing is finished but input buffer is not empty.
Thank you.