rust-lang / flate2-rs

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

Fixed overflow bug in crc combine #330

Closed AntonJMLarsson closed 1 year ago

AntonJMLarsson commented 1 year ago

The combine function for the CRC hash can cause integer overflow if the amt variable is close to u32::MAX. To fix this I changed the regular add to wrapping add, the same way the update function works.