Skip to content

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Mar 30, 2022

RUST-1240

Because length_remaining is an i32, the checked_sub call would allow (invalid) negative values; this was caught by the fuzzer because this particular fuzz input happened to create a value negative enough that further subtraction elsewhere underflowed.

As far as I can tell this doesn't have safety implications; the underlying buffer is accessed through a safe slice, so this would have caused a panic or at worst garbage parsed data.

Copy link
Contributor

@patrickfreed patrickfreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@abr-egn abr-egn merged commit ffcbf70 into mongodb:master Mar 30, 2022
abr-egn added a commit to abr-egn/bson-rust that referenced this pull request Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants