roaring-rs icon indicating copy to clipboard operation
roaring-rs copied to clipboard

Potential overflow when decoding in `RoaringBitmap::deserialize_from_impl()`

Open kirk-baird opened this issue 1 year ago • 0 comments

What is the issue

There is an overflow in deserialize_from_impl() that can be reached if s + len overflow a u16.

The overflow is reachable as both s and len are decoded from user input.

Noting in release mode this will wrapping overflow and not cause a panic. However, a panic would occur in debug mode.

What is the solution

Use checked math and propagate the error.

kirk-baird avatar Apr 08 '24 01:04 kirk-baird