Skip to content

cosmwasm_vm::memory::read_region panics on ptr == 0 #416

@reuvenpo

Description

@reuvenpo

This is an issue because the ptr is supplied in the contract when calling the function from wasm imports.
This is not disastrous because Rust panics are caught just before returning to Go, but we can handle this more gracefully.
For example, we have the maybe_read_region function, that returns a None when the ptr is 0. We can use this function instead, and then convert the None case to a variant of VmError. This will then mesh well with all the other error handling in the VM.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestvmcosmwasm-vm crate

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions