overflow panic in update_buffer
Closed this issue · 1 comments
remram44 commented
Original issue from oyvindln
Monday September 19, 2016 11:53 UTC
See rs-sync#6
Calling RollingAdler32::update_buffer() on a long slice causes a panic due to overflow:
thread 'tests::it_works' panicked at 'attempted to add with overflow', /<removed>/registry/src/github.com-1ecc6299db9ec823/adler32-0.2.0/src/lib.rs:55
Code that reproduces the issue:
let mut c = RollingAdler32::new();
let buffer = vec![255; 64000];
c.update_buffer(&buffer);
I presume the fix would be to use wrapping_add to indicate that overflows are supposed to happen.