Skip to content

Validate Region in get_region #419

@webmaster128

Description

@webmaster128

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestvmcosmwasm-vm crate

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions