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

Fixed Panic due to out-of-bounds slice access while decoding FixedArray of dynamically sized types #250

Merged
merged 3 commits into from
Oct 27, 2021

Conversation

f0rki
Copy link
Contributor

@f0rki f0rki commented Oct 27, 2021

I found this via fuzzing and I already had the fix in the PR #221 but it did not receive any attention. So this PR is my next attempt to land this fix. This time with a minimal reproducer testcase. The problem is essentially the same as I fixed in PR #203. When attempting to decode a corrupted FixedArray of a dynamically sized type (e.g., string[5] or uint[5][]) one needs to check whether the offset is legitimate to avoid panicking.

Copy link
Member

@vkgnosis vkgnosis left a comment

Choose a reason for hiding this comment

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

Thank you for the fix and sorry about forgetting the other PR. CI fails because of formatting. Could you run cargo fmt on the PR?

@f0rki
Copy link
Contributor Author

f0rki commented Oct 27, 2021

@vkgnosis sure. pushed.

Copy link
Contributor

@nlordell nlordell left a comment

Choose a reason for hiding this comment

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

LGTM

@vkgnosis vkgnosis merged commit 48d10ad into rust-ethereum:master Oct 27, 2021
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