ucrt: a failed memmove_s leaves the destination unmodified #96
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!96
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-96"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Olima34 on GitHub · 2026-11-26 14:29 UTC · original
Olima34:fix/ucrt-memmove-s-keeps-destination→main· +30 −3 · 1 files · 2 commits · merged 2026-11-26 15:26 UTCWhat this changes
memmove_shanded its errors tomemcpy_s, which zeroes the destination for a null source or a destination too small. Microsoft'smemmove_sreference lists "not modified" for all three error cases (null destination, null source, too small), unlikememcpy_s, so it now returnsEINVALorERANGEitself and leaves the destination as it was. A count of 0 is still a success. New testmemmove_s_leaves_the_destination_alone_on_error_and_memcpy_s_zeroes_it(it also pinsmemcpy_s's zeroing and an overlapping move).How it was tested
cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory(all pass); the new test fails onmaincargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, also with--all-features; clippy forx86_64-apple-darwinreports nothing in the file touchedcargo test --workspaceandcargo xtask policyChecklist
VICTORY_*variable and documented (none added)@LakshanSivakumar on GitHub · 2026-11-26 14:55 UTC · original · approved these changes
memmove_s leaves the destination untouched on error, as documented, and memcpy_s zeroing is pinned in the test. Thanks.