HLE: enforce XSystemXboxLiveSandboxId minimum buffer size (fixes #862) #972
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/972"
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 pushkarreddyy on 2026-11-24T14:36:19Z.
Summary
Enforces
XSystemXboxLiveSandboxIdMaxBytes(16 bytes) onsandbox_id, resolving #862.Changes
crates/victory-hle/src/modules/xsystem.rs:const SANDBOX_ID_MAX_BYTES: usize = 16;matching GDKXSystem.h.sandbox_id, checkedif size < SANDBOX_ID_MAX_BYTES { return super::xasync::E_NOT_SUFFICIENT_BUFFER; }prior to delegating toput_string.a_sandbox_id_buffer_under_the_documented_minimum_is_refusedverifying buffer sizes 0, 7, and 15 returnE_NOT_SUFFICIENT_BUFFER(0x8007007A) leaving the buffer andusedcount untouched, while size 16 succeeds (S_OK) with"RETAIL\0"andused = 7.Verification
cargo test -p victory-hle.Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T14:39:39Z.
Review: CHANGES_REQUESTED
Tested
d3633c5on Windows 11, RTX 5070, MSVC:cargo test -p victory-hledoes not compile:xsystem.rs:417, insidemod tests:super::xasync::E_NOT_SUFFICIENT_BUFFERfails with E0433 "cannot findxasyncinsuper". In the test modulesuperisxsystem, notmodules, so the path doesn't resolve. The non-test use at module level is fine. Fix: usecrate::modules::xasync::E_NOT_SUFFICIENT_BUFFERin the test, oruse super::*;and refer to it the same way the production code does.size < XSystemXboxLiveSandboxIdMaxBytesbefore writing, and leavingbufferanduseduntouched on failure, is what the test asserts and matches the GDK contract.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:13:16Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
d3633c5:cargo test -p victory-hledoes not compile:The line is added by this PR;
crate::modules::xasync::E_NOT_SUFFICIENT_BUFFERshould work. main (ffe310e) builds and passes on the same machine.Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T15:28:40Z.
Thanks @Zipettte for the sharp catch and test run!
Pushed commit
886a867importingE_NOT_SUFFICIENT_BUFFERviacrate::modules::xasyncsomod testsresolves the symbol cleanly.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:28:59Z.
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #939.
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.
upstream-sync referenced this pull request2026-11-25 02:06:02 +00:00
Pull request closed