RPC: UuidFromString takes only the dashed GUID form, braces paired (junk after } was accepted) #261

Open
sharan104 wants to merge 1 commit from upstream-pr/261 into main
sharan104 commented 2026-11-26 13:33:33 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by sharan104 on 2026-11-26T13:33:33Z.


rpcrt4.rs parse(), which UuidFromStringA/W use, skipped dashes wherever they stood, and returned as soon as a } followed the 32nd digit. So malformed text returned RPC_S_OK where the runtime returns RPC_S_INVALID_STRING_UUID:

  • junk after the closing brace: …abcde}junk
  • a brace with no pair: {… or …}
  • doubled braces: {{…}
  • dashes missing or out of place

The function's own comment ("the dashes in place") and the existing garbage_is_refused test show this text was meant to be refused.

Fix: the text must be exactly xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, optionally inside one pair of braces. Braces stay accepted, as the code and its test deliberately allow. parse has no other callers.

Test: malformed_guid_text_is_refused covers 9 malformed strings. It fails before the change and passes after it (10 runs out of 10). The existing valid-GUID tests (upper case, braces, A and W) still pass.

Results:

  • cargo test -p victory-hle --locked: 156 passed, 2 ignored.
  • cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warnings is clean, with and without --all-features.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6627780927 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/261). Originally posted by [sharan104](https://github.com/sharan104) on 2026-11-26T13:33:33Z. --- `rpcrt4.rs` `parse()`, which `UuidFromStringA/W` use, skipped dashes wherever they stood, and returned as soon as a `}` followed the 32nd digit. So malformed text returned `RPC_S_OK` where the runtime returns `RPC_S_INVALID_STRING_UUID`: - junk after the closing brace: `…abcde}junk` - a brace with no pair: `{…` or `…}` - doubled braces: `{{…}` - dashes missing or out of place The function's own comment ("the dashes in place") and the existing `garbage_is_refused` test show this text was meant to be refused. **Fix:** the text must be exactly `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`, optionally inside one pair of braces. Braces stay accepted, as the code and its test deliberately allow. `parse` has no other callers. **Test:** `malformed_guid_text_is_refused` covers 9 malformed strings. It fails before the change and passes after it (10 runs out of 10). The existing valid-GUID tests (upper case, braces, `A` and `W`) still pass. **Results:** - `cargo test -p victory-hle --locked`: 156 passed, 2 ignored. - `cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warnings` is clean, with and without `--all-features`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/261:upstream-pr/261'
git switch 'upstream-pr/261'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/261'
git switch 'upstream-pr/261'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/261'
git switch 'upstream-pr/261'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/261'
git switch 'main'
git merge --squash 'upstream-pr/261'
git switch 'main'
git merge --ff-only 'upstream-pr/261'
git switch 'main'
git merge 'upstream-pr/261'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!261
No description provided.