HLE: refuse a null AnalyticsInfo output pointer #449

Closed
github-bot wants to merge 1 commit from gh-pr/449/head into gh-pr/449/base
Owner

@⁠enzoduarte1 on GitHub · 2026-11-24 03:32 UTC · original
enzoduarte1:hle/analytics-null-output → main · +6 −0 · 1 files · 1 commits · closed without merging

What

XSystemGetAnalyticsInfo's HLE implementation wrote the struct through out without checking it. Other HLE entry points tolerate null output pointers (for example put returns E_INVALIDARG), and a null pointer here would fault the process.

The function now returns null when out is null; the normal path is unchanged. The existing vtable test also checks the null case.

Tested

  • Windows 11, Rust 1.98.1, x86_64-pc-windows-gnu (no MSVC linker on this machine).
  • cargo test -p victory-hle --lib xsystem::: 4 passed.
  • cargo test --workspace --exclude victory-loader -- --test-threads=1: all suites passed.
  • cargo clippy -p victory-hle --all-targets -- -A clippy::field_reassign_with_default -D warnings: clean. The allowed lint is the pre-existing warning fixed by PR #355.
  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xsystem.rs and git diff --check: clean.
  • cargo xtask policy: 151 files ok. No game files or data taken from them were added.
  • Not tested: cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's /DELAYLOAD flag, which MinGW rejects here; the same failure occurs on unmodified main.

Checklist

  • cargo fmt, cargo clippy --workspace --all-targets and cargo test --workspace pass — see the toolchain limitations above; the changed crate is clean.
  • cargo xtask policy passes. The change adds no game files or data taken from them (docs/asset-policy.md).
  • If an AI tool wrote part of this change, the description says so: an AI tool assisted with the code and test; I reviewed and ran them.
**@⁠enzoduarte1** on GitHub · 2026-11-24 03:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/449) `enzoduarte1:hle/analytics-null-output` → `main` · +6 −0 · 1 files · 1 commits · closed without merging ## What `XSystemGetAnalyticsInfo`'s HLE implementation wrote the struct through `out` without checking it. Other HLE entry points tolerate null output pointers (for example `put` returns `E_INVALIDARG`), and a null pointer here would fault the process. The function now returns null when `out` is null; the normal path is unchanged. The existing vtable test also checks the null case. ## Tested - Windows 11, Rust 1.98.1, `x86_64-pc-windows-gnu` (no MSVC linker on this machine). - `cargo test -p victory-hle --lib xsystem::`: 4 passed. - `cargo test --workspace --exclude victory-loader -- --test-threads=1`: all suites passed. - `cargo clippy -p victory-hle --all-targets -- -A clippy::field_reassign_with_default -D warnings`: clean. The allowed lint is the pre-existing warning fixed by PR #355. - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xsystem.rs` and `git diff --check`: clean. - `cargo xtask policy`: 151 files ok. No game files or data taken from them were added. - Not tested: `cargo test -p victory-loader --test load_probe`. Its fixture passes MSVC's `/DELAYLOAD` flag, which MinGW rejects here; the same failure occurs on unmodified `main`. ## Checklist - [ ] `cargo fmt`, `cargo clippy --workspace --all-targets` and `cargo test --workspace` pass — see the toolchain limitations above; the changed crate is clean. - [x] `cargo xtask policy` passes. The change adds no game files or data taken from them (`docs/asset-policy.md`). - [x] If an AI tool wrote part of this change, the description says so: an AI tool assisted with the code and test; I reviewed and ran them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:04:27 +00:00
github-bot closed this pull request 2026-11-26 04:04:27 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:02 UTC · original

Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

Guards the analytics struct's output pointer against null, but that pointer is the compiler's hidden return slot for a struct returned by value and is never null.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/449#issuecomment-7148078879) Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current). Guards the analytics struct's output pointer against null, but that pointer is the compiler's hidden return slot for a struct returned by value and is never null. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!449
No description provided.