-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
432: feat(runtime-c-api) Check buffer size before creating the slice r=Hywan a=Hywan It's safer to check the buffer size is large enough to hold the error message before creating the slice from raw parts. Also, this patch remove the need for `last_error`, simplifying the code a little bit. The `length` variable is casted to `usize` once. This patch also updates the returned value of `wasmer_last_error_message` by adding 1, so that it mimics the `wasmer_last_error_length` function that counts the trailing null byte. Co-authored-by: Ivan Enderlin <[email protected]>
- Loading branch information
Showing
2 changed files
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters