diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-05-23 20:30:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-23 20:30:08 +0200 |
| commit | c66c8e6b9c227d2e44701a50294e23a7a2143fa4 (patch) | |
| tree | 888cee6f55c5f0215853422bff3000c318b54720 /tests/codegen/src-hash-algorithm | |
| parent | e88e85463468ce5d5ce468414eb69e3b15fa8d42 (diff) | |
| parent | 89a90d664082280584a27cc8030aba85d122448f (diff) | |
| download | rust-c66c8e6b9c227d2e44701a50294e23a7a2143fa4.tar.gz rust-c66c8e6b9c227d2e44701a50294e23a7a2143fa4.zip | |
Rollup merge of #138896 - joboet:process_noalias, r=Noratrieb
std: fix aliasing bug in UNIX process implementation `CStringArray` contained both `CString`s and their pointers. Unfortunately, since `CString` uses `Box`, moving the `CString`s into the `Vec` can (under stacked borrows) invalidate the pointer to the string, meaning the resulting `Vec<*const c_char>` was, from an opsem perspective, unusable. This PR removes removes the `Vec<CString>` from `CStringArray`, instead recreating the `CString`/`CStr` from the pointers when necessary. Also,`CStringArray` is now used for the process args as well, the old implementation was suffering from the same kind of bug.
Diffstat (limited to 'tests/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
