rust-lang / flate2-rs

DEFLATE, gzip, and zlib bindings for Rust
https://docs.rs/flate2
Apache License 2.0
929 stars 163 forks source link

gzdecoder: fix endless loop in read implementation #280

Closed catenacyber closed 3 years ago

catenacyber commented 3 years ago

Introduced by commit 7212da84fa0a9fe77c240e95a675f0567e9d698c Adds a test to prevent this behavior

@alexcrichton sorry for turning a quadratic complexity into an endless loop

You can check that the test does not end without the patch in impl<R: BufRead> Read for GzDecoder<R>

alexcrichton commented 3 years ago

No worries, thanks!