HLE: refuse a null AnalyticsInfo output pointer #449
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/449"
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?
Imported from Marvisak/VIctory. Originally posted by enzoduarte1 on 2026-11-24T03:32:12Z.
What
XSystemGetAnalyticsInfo's HLE implementation wrote the struct throughoutwithout checking it. Other HLE entry points tolerate null output pointers (for exampleputreturnsE_INVALIDARG), and a null pointer here would fault the process.The function now returns null when
outis null; the normal path is unchanged. The existing vtable test also checks the null case.Tested
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.rsandgit diff --check: clean.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADflag, which MinGW rejects here; the same failure occurs on unmodifiedmain.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:08:09Z.
Review: APPROVED
Tested
f625cc5on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (264 passed, 0 failed), including the loaderload_probetest you could not run under MinGW.analytics_infonow returns null for a nulloutinstead of writing through it. Returningoutitself (null) keeps the hidden-return-pointer contract: the caller gets back the address it passed.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:02:53Z.
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