-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add potential fix for OOR access on Vector #54
Conversation
Note this is in reference to #22 |
In reference to #22 I changed it to instead use the .get() method on encoding. To my knowledge there isn't a good way to get the exact reason of the failure so I just added a generic DeserializeError::InvalidRange{range: Range, buffer_length: usize}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! let's unpack the code a bit and I think DeserializeError::ExpectedFurtherInput
makes more sense here -- what do you think?
Unlike the issue this does not use the safe vec::get method, but does emit an already defined DeserializeError. I am open to other options for the easiest way to fix this. If this is a desired approach I can add some other guards where they are needed.