-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat(runtime-c-api) Check buffer size before creating the slice, and fix wasmer_last_error_message
returned value
#432
Merged
Conversation
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
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.
bors try |
Returning the error message's length + 1 mimics the `wasmer_last_error_length` function that counts the trailing null byte.
bors try |
tryAlready running a review |
Hywan
changed the title
feat(runtime-c-api) Check buffer size before creating the slice
[WIP] feat(runtime-c-api) Check buffer size before creating the slice
May 10, 2019
bjfish
approved these changes
May 10, 2019
I'm not sure about the last patch. I want to write a small test suite before merging. |
syrusakbary
reviewed
May 10, 2019
syrusakbary
approved these changes
May 10, 2019
Hywan
changed the title
[WIP] feat(runtime-c-api) Check buffer size before creating the slice
feat(runtime-c-api) Check buffer size before creating the slice
May 13, 2019
bors r+ |
bors bot
added a commit
that referenced
this pull request
May 13, 2019
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 <ivan.enderlin@hoa-project.net>
bors r- |
Canceled |
Hywan
changed the title
feat(runtime-c-api) Check buffer size before creating the slice
feat(runtime-c-api) Check buffer size before creating the slice, and fix May 13, 2019
wasmer_last_error_message
returned value
bors r+ |
bors bot
added a commit
that referenced
this pull request
May 13, 2019
432: feat(runtime-c-api) Check buffer size before creating the slice, and fix `wasmer_last_error_message` returned value 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 <ivan.enderlin@hoa-project.net>
bors bot
added a commit
that referenced
this pull request
Aug 19, 2019
693: Bump cc from 1.0.38 to 1.0.40 r=Hywan a=dependabot-preview[bot] Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.38 to 1.0.40. <details> <summary>Commits</summary> - [`6ad3da7`](rust-lang/cc-rs@6ad3da7) Bump to 1.0.40 - [`9fcdab9`](rust-lang/cc-rs@9fcdab9) Fix a bad merge typo - [`fa98eb0`](rust-lang/cc-rs@fa98eb0) Bump to 1.0.39 - [`0187762`](rust-lang/cc-rs@0187762) Add CUDA support for MSVC ([#426](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/426)) - [`5c0dc67`](rust-lang/cc-rs@5c0dc67) Merge pull request [#433](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/433) from turboladen/feature/config-ios-version-min - [`f99a424`](rust-lang/cc-rs@f99a424) Merge pull request [#432](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/432) from BaoshanPang/master - [`5ab556e`](rust-lang/cc-rs@5ab556e) use wr-c++ instead of vx-cxx - [`bae28ef`](rust-lang/cc-rs@bae28ef) Detect and use `IPHONEOS_DEPLOYMENT_TARGET` for the `-mi*os-version-min` flag - [`13e04b1`](rust-lang/cc-rs@13e04b1) Merge pull request [#430](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/430) from laanwj/2019_08_rv_nopic - [`c7cd5dd`](rust-lang/cc-rs@c7cd5dd) Merge pull request [#429](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/429) from laanwj/2019_08_rv_correct_abi - Additional commits viewable in [compare view](rust-lang/cc-rs@1.0.38...1.0.40) </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.0.38&new-version=1.0.40)](https://dependabot.com/compatibility-score.html?dependency-name=cc&package-manager=cargo&previous-version=1.0.38&new-version=1.0.40) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- **Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit. You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com). <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot. </details> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thecode a little bit. The
length
variable is casted tousize
once.This patch also updates the returned value of
wasmer_last_error_message
by adding 1, so that it mimics thewasmer_last_error_length
function that counts the trailing null byte.