HLE rpcrt4: fix GUID brace parsing and UuidToString OOM handling #3376
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3376
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3376"
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?
@Arkenoz on GitHub · 2026-11-26 20:55 UTC · original
Arkenoz:fix/rpcrt4-parse-oom→main· +38 −5 · 1 files · 1 commits · openTracked in #1633.
Problem
parse()incrates/victory-hle/src/modules/rpcrt4.rsaccepted trailing characters after a closing}(returning immediately without checking that the iterator was exhausted), unmatched braces ({...or...}), and repeated opening braces ({{...}).UuidToStringAandUuidToStringWignored allocation failure fromallocate(), writing a null pointer tooutand returningOKinstead ofOUT_OF_MEMORY.Changes
{was seen inparse(), rejecting repeated{, unmatched braces, and any trailing characters after}.allocate(&bytes)for null inUuidToStringAandUuidToStringW, returningOUT_OF_MEMORYwithout writing toout.garbage_is_refusedfor trailing characters after}, unmatched braces, and duplicate opening braces.Verification
cargo test -p victory-hle rpcrt4(5 passed)cargo clippy -p victory-hle --all-targets(0 warnings)AI-assisted with Gemini.
@Dukestar69 on GitHub · 2026-11-26 21:09 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).OUT_OF_MEMORYon null allocation inUuidToStringA/UuidToStringWand rejecting mismatched/duplicate braces or trailing garbage inparsecleanly hardensrpcrt4.cargo test -p victory-hle --lib modules::rpcrt4:: -- --test-threads=1: 5 passed, 0 failed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.