XUser: reject an unknown gamertag component #429

Open
davutsimsekk wants to merge 1 commit from upstream-pr/429 into main
davutsimsekk commented 2026-11-25 00:43:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-25T00:43:37Z.


XUserGetGamertag matched every component other than ModernSuffix and returned S_OK with the classic gamertag. The GDK enum has only four values (classic, modern, modern suffix, unique modern); an unknown component is documented as E_INVALIDARG.

This returns E_INVALIDARG for components 4 and above and leaves the output buffer untouched. The four valid components are unchanged.

Test

an_unknown_gamertag_component_is_an_invalid_argument checks component 4 through both the gamertag object and the user object, and asserts the buffer was not written. On main the call returns S_OK.

  • cargo test -p victory-hle --lib: 97 passed, 0 failed
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean
  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xuser.rs: clean
  • No game data or GPU was used.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6594474265 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/429). Originally posted by [davutsimsekk](https://github.com/davutsimsekk) on 2026-11-25T00:43:37Z. --- `XUserGetGamertag` matched every component other than `ModernSuffix` and returned `S_OK` with the classic gamertag. The GDK enum has only four values (classic, modern, modern suffix, unique modern); an unknown component is documented as `E_INVALIDARG`. This returns `E_INVALIDARG` for components 4 and above and leaves the output buffer untouched. The four valid components are unchanged. ## Test `an_unknown_gamertag_component_is_an_invalid_argument` checks component 4 through both the gamertag object and the user object, and asserts the buffer was not written. On `main` the call returns `S_OK`. - `cargo test -p victory-hle --lib`: 97 passed, 0 failed - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings`: clean - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xuser.rs`: clean - No game data or GPU was used.
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/429:upstream-pr/429'
git switch 'upstream-pr/429'

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/429'
git switch 'upstream-pr/429'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/429'
git switch 'upstream-pr/429'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/429'
git switch 'main'
git merge --squash 'upstream-pr/429'
git switch 'main'
git merge --ff-only 'upstream-pr/429'
git switch 'main'
git merge 'upstream-pr/429'
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
fxceless/victory-fork!429
No description provided.