Skip to content
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

Fix some overflows and division-by-zero in .debug_aranges handling #510

Merged

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented May 18, 2020

No description provided.

@fitzgen fitzgen requested a review from philipc May 18, 2020 18:28
Copy link
Collaborator

@philipc philipc left a comment

Choose a reason for hiding this comment

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

Good finds!

let tuple_length = address_size
.checked_mul(2)
.and_then(|x| x.checked_add(segment_size))
.ok_or(Error::InvalidAddressRange)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't really an appropriate error message, but I don't care too much.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, the error variant's name is sort of relevant, but the display isn't. But it also didn't feel like this deserved its own new variant.

@fitzgen fitzgen merged commit 33ea786 into gimli-rs:master May 19, 2020
@fitzgen fitzgen deleted the overflows-and-div-by-zero-in-debug-aranges branch May 19, 2020 15:35
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.

None yet

2 participants