HLE: validate null pointer in ApuIsVirtualAddressValid and overflow in ApuAlloc #528
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!528
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/528/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:28 UTC · original
pushkarreddyy:fix/audio-apu-validation→main· +23 −5 · 1 files · 1 commits · closed without mergingProblem
In
crates/victory-hle/src/modules/audio.rs:ApuIsVirtualAddressValiddoes not short-circuit on null pointers before callingheap_map(0).ApuMapVirtualAddressdoes not check for null input.ApuAllocdoes not check for arithmetic overflow when validatingsizeandalign.Fix
falseifptr.is_null()inApuIsVirtualAddressValid.0ifptr.is_null()inApuMapVirtualAddress.size.checked_add(align).is_none()inApuAlloc.No game files used.
@pushkarreddyy on GitHub · 2026-11-24 04:51 UTC · original
### Technical Verification & Implementation Details
Context & Root Cause
In
crates/victory-hle/src/modules/audio.rs:ApuIsVirtualAddressValidcalledheap_map(0)when passed null pointers instead of short-circuiting tofalse.ApuMapVirtualAddressdid not check for null pointer input.ApuAllocperformed unbounded arithmeticsize + alignwithout overflow checks.Changes & Diff
0(false) immediately ifptr.is_null()inApuIsVirtualAddressValid.0immediately ifptr.is_null()inApuMapVirtualAddress.size.checked_add(align).is_none()inApuAlloc.Git Log Line & Verification
ext b1539b7 HLE: validate null pointer in ApuIsVirtualAddressValid and overflow in ApuAlloc crates/victory-hle/src/modules/audio.rs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-)cargo xtask policy(Rule #1 compliance, zero game assets).rustfmt --edition 2024.@pushkarreddyy on GitHub · 2026-11-24 06:15 UTC · original
Thank you @LAKSHYA-cmd-tech for testing and verifying on Windows 11! Glad all 87 tests and asset policy passed cleanly.
@pushkarreddyy on GitHub · 2026-11-24 06:23 UTC · original
### Ready for Merge
Verified and approved on Windows 11 by @LAKSHYA-cmd-tech (all unit tests passing, zero Clippy warnings, asset policy passing).
@Marvisak: Ready for maintainer review and merge when you have time!
@pushkarreddyy on GitHub · 2026-11-24 12:38 UTC · original
Thank you @mercuryVM for testing and approving!
Acknowledged on keeping functional diffs strictly separated from formatting hunks—I'll ensure future HLE PRs isolate formatting into dedicated commits for maximum review clarity.
@pushkarreddyy on GitHub · 2026-11-24 13:01 UTC · original
@Marvisak: PR #528 has approvals from both @LAKSHYA-cmd-tech and @mercuryVM (verified clean on Windows 11 MSVC with all 87 HLE tests passing and Rule #1 compliant). Whenever you have a moment, this is ready to merge!
@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).
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