HLE: guard dialog commands before initialization #1514
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1515"
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 Calvix2k on 2026-11-24T18:40:29Z.
Summary
Fixes
VIC-BT-033from audit issue #1242.The dialog procedure handled
WM_COMMANDby immediately turningGWLP_USERDATAinto a mutableEntryreference. If a command arrives beforeWM_INITDIALOGhas stored the entry pointer, this dereferences null. The procedure now ignores commands while user data is unset.A Windows regression test invokes the command handler before initialization and verifies it safely returns without handling the command.
Verification
cargo test -p victory-hle --lib --locked— 95 passedcargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings— cleancargo xtask policy --staged— passedgit diff --check— passedA file-specific
rustfmt --checkreports pre-existing formatting differences elsewhere inxgameui.rs; no unrelated formatting changes are included.Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:30:19Z.
Heads-up: #1373 (opened about an hour earlier) adds the same check.
dialog::procedurereturns early on a zeroGWLP_USERDATAinWM_COMMAND. The two conflict inxgameui.rs.Tested on Windows 11 with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-hlemainmain+ this PRcargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T00:41:37Z.
Heads-up acknowledged. #1373 is now closed, so this PR is the surviving fix for the null GWLP_USERDATA case in XGameUi. The xgameui.rs conflict is therefore moot; this one is mergeable and should be the one to take.