Skip to content

clang::Comment::num_children should bounds check its argument #142

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

Closed
fitzgen opened this issue Oct 25, 2016 · 2 comments
Closed

clang::Comment::num_children should bounds check its argument #142

fitzgen opened this issue Oct 25, 2016 · 2 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Oct 25, 2016

The Clang docs don't specify what happens if we request a child comment that is out of bounds. We should make sure we don't do it at all. We can make the function return an Option<Comment> instead of plain Comment and return None if i >= self.num_children(). Otherwise we can proceed normally and return Some.

I can mentor whoever would like to work on this.

@highfive
Copy link

Please make a comment here if you intend to work on this issue. Thank you!

@catdesk
Copy link
Contributor

catdesk commented Oct 29, 2016

I'd like to work on this, but is it actually Comment::get_child that needs to be modified?

catdesk added a commit to catdesk/rust-bindgen that referenced this issue Oct 29, 2016
catdesk added a commit to catdesk/rust-bindgen that referenced this issue Oct 29, 2016
KiChjang pushed a commit to catdesk/rust-bindgen that referenced this issue Oct 30, 2016
bors-servo pushed a commit that referenced this issue Oct 30, 2016
Check bounds when calling Comment::get_child (fix #142)

Fixes #142.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants