add missing null ptr check in alloc example#99198
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 18, 2022
Merged
Conversation
Collaborator
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Contributor
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
Noratrieb
reviewed
Jul 13, 2022
JohnTitor
approved these changes
Jul 18, 2022
Member
|
Looks sensible to me, @bors r+ rollup |
Collaborator
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 18, 2022
add missing null ptr check in alloc example `alloc` can return null on OOM, if I understood correctly. So we should never just deref a pointer we get from `alloc`.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 18, 2022
add missing null ptr check in alloc example `alloc` can return null on OOM, if I understood correctly. So we should never just deref a pointer we get from `alloc`.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 18, 2022
add missing null ptr check in alloc example `alloc` can return null on OOM, if I understood correctly. So we should never just deref a pointer we get from `alloc`.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 18, 2022
add missing null ptr check in alloc example `alloc` can return null on OOM, if I understood correctly. So we should never just deref a pointer we get from `alloc`.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 18, 2022
Rollup of 7 pull requests Successful merges: - rust-lang#98839 (Add assertion that `transmute_copy`'s U is not larger than T) - rust-lang#98998 (Remove branch target prologues from `#[naked] fn`) - rust-lang#99198 (add missing null ptr check in alloc example) - rust-lang#99344 (rustdoc: avoid inlining items with duplicate `(type, name)`) - rust-lang#99351 (Use `typeck_results` to get accurate qpath res for arg mismatch error) - rust-lang#99378 (interpret/visitor: add missing early return) - rust-lang#99394 (Add regression test for rust-lang#95230) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
cuviper
added a commit
to cuviper/rust
that referenced
this pull request
Nov 12, 2024
We should demonstrate good behavior, just like rust-lang#99198 did for `alloc`.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 12, 2024
…ss35 Check for null in the `alloc_zeroed` example We should demonstrate good behavior, just like rust-lang#99198 did for `alloc`.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 12, 2024
Rollup merge of rust-lang#132929 - cuviper:check-alloc_zeroed, r=tgross35 Check for null in the `alloc_zeroed` example We should demonstrate good behavior, just like rust-lang#99198 did for `alloc`.
This file contains hidden or 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
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.
alloccan return null on OOM, if I understood correctly. So we should never just deref a pointer we get fromalloc.