HLE: guard dialog commands before initialization #1515
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1515
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1515/head"
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?
@Calvix2k on GitHub · 2026-11-24 18:40 UTC · original
Calvix2k:codex/ui-dialog-command-guard-033→main· +18 −1 · 1 files · 1 commits · merged 2026-11-25 00:14 UTCSummary
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.@acetonahard-code on GitHub · 2026-11-24 22:30 UTC · original
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.
@Calvix2k on GitHub · 2026-11-25 00:41 UTC · original
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.