dermesser / integer-encoding-rs

Integer encoding for primitive integer types: Supports varint/varint+zigzag and fixed-length integer encoding and decoding, and provides synchronous and asynchronous Write/Read types for easily writing/reading integers.
Other
66 stars 16 forks source link

Handling varint decode errors #9

Closed SOF3 closed 4 years ago

SOF3 commented 4 years ago

If all bytes of the slice have MSB set, the library assumes the last slice does not have the MSB set, and silently truncates.

Furthermore, if the value of the varint overflows, it silently drops the overflowing bits.

These are malformed representations and should have error reported.

dermesser commented 4 years ago

thank you, I've seen the issue! I will take a look when I have a bit of time.

dermesser commented 4 years ago

I hope I will soon get a chance to fix this.