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

Validate Region in get_region #419

Closed
webmaster128 opened this issue Jun 10, 2020 · 0 comments · Fixed by #473
Closed

Validate Region in get_region #419

webmaster128 opened this issue Jun 10, 2020 · 0 comments · Fixed by #473
Labels
enhancement New feature or request vm cosmwasm-vm crate
Milestone

Comments

@webmaster128
Copy link
Member

webmaster128 commented Jun 10, 2020

When working on AssemblyScript support, I ran in many different situations where wrong Region pointers where communicated to the VM. Since you can basically dereference any 12 bytes of memory to a Region, those situations were hard to debug. In order to error out as soon as possible, we can do some validation on the Region.

The following things can be validated:

  • length <= capacity
  • offset != 0
  • offset + capacity is within the size of the memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vm cosmwasm-vm crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant