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 length checking overflow in EVM revert reason parsing #820

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

sorpaas
Copy link
Member

@sorpaas sorpaas commented Aug 15, 2022

Our current code in parsing the EVM revert reason is incorrect in two ways. First, the length is a big-endian encoded U256, not a simple sum. Second, the current summing function uses the accumulator type of u8 which will overflow easily. The current code only works because most EVM revert reasons are not larger than 256 bytes.

@sorpaas sorpaas merged commit fff8cc4 into master Aug 15, 2022
@sorpaas sorpaas deleted the sp-fix-overflow-rpc-revert-reason branch August 15, 2022 13:01
boundless-forest pushed a commit to darwinia-network/frontier that referenced this pull request Aug 15, 2022
…vm#820)

* Fix length checking overflow in EVM revert reason parsing

* Remove unused debug_assert
nanocryk pushed a commit to moonbeam-foundation/frontier that referenced this pull request Aug 16, 2022
…vm#820)

* Fix length checking overflow in EVM revert reason parsing

* Remove unused debug_assert
abhijeetbhagat pushed a commit to web3labs/frontier that referenced this pull request Jan 11, 2023
…vm#820)

* Fix length checking overflow in EVM revert reason parsing

* Remove unused debug_assert
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.

1 participant