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

Panic during read #3

Closed anna-is-cute closed 6 years ago

anna-is-cute commented 6 years ago

At this line, I'm encountering a panic when i becomes 10 and then the index is invalid. Should probably return an Err when i becomes that large, rather than indirectly cause a panic.

dermesser commented 6 years ago

definitely. I hope 8eb722f fixes it. Another commit on top of that also protects the varint decoder from overly long bytestrings.

anna-is-cute commented 6 years ago

Awesome! Thank you very much.