HLE: validate pointers in XGameUi text entry result and size getters #519
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!519
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/519/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?
@pushkarreddyy on GitHub · 2026-11-24 04:25 UTC · original
pushkarreddyy:fix/xgameui-text-entry-null-checks→main· +51 −11 · 1 files · 1 commits · closed without mergingProblem
In
crates/victory-hle/src/modules/xgameui.rs:text_entry_sizedoes not check ifoutis null before querying result size, risking an invalid argument return code or write failure.text_entry_resultdoes not check whetherbufferis null whensize > 0.Fix
xasync::E_INVALIDARGifout.is_null()intext_entry_size.xasync::E_INVALIDARGifsize > 0 && buffer.is_null()intext_entry_result.No game files used.
@pushkarreddyy on GitHub · 2026-11-24 04:50 UTC · original
### Technical Verification & Implementation Details
Context & Root Cause
In
crates/victory-hle/src/modules/xgameui.rs,XGameUiShowTextEntryResultSizeandXGameUiShowTextEntryResultdereferenced out-pointers (result_text_byte_count,result_text) without validating whether the caller passed a null pointer, causing access violations when games query status or pass null buffers.Changes & Diff
E_INVALIDARG(0x80070057) if null.text_entry_result_size_rejects_nullandtext_entry_result_rejects_null.Git Log Line & Verification
ext 4ab8bca HLE: validate pointers in XGameUi text entry result and size getters crates/victory-hle/src/modules/xgameui.rs | 62 +++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 11 deletions(-)cargo xtask policy(Rule #1 compliance, zero game assets).rustfmt --edition 2024.@pushkarreddyy on GitHub · 2026-11-24 06:24 UTC · original
### Call for Testing & Maintainer Review
Community members testing game initialization or HLE modules on Windows 10/11: verification and feedback on this PR is warmly welcome!
cargo xtask policypassing).@Marvisak: Ready for maintainer review and merge when convenient!
@pushkarreddyy on GitHub · 2026-11-24 11:27 UTC · original
Thank you @mercuryVM for testing and approving! Acknowledged on the rustfmt reflow nit—will keep diffs strictly minimal on future HLE PRs.
@Marvisak on GitHub · 2026-11-25 00:03 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).
No value: the null-output check repeats what put() already returns, the other check only swaps one error code for another without evidence, and the rest reformats about 40 unrelated lines.
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