hle: validate null out pointers before allocating in dstorage and xgamesave #3154

Open
RanoGames wants to merge 1 commit from upstream-pr/3154 into main
RanoGames commented 2026-11-29 20:20:34 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by RanoGames on 2026-11-29T20:20:34Z.


What it changes

  • Adds early out.is_null() checks returning E_INVALIDARG before allocating heap objects, Win32 events, or scheduler lanes in dstorage::create_status_array, dstorage::new_queue, xgamesave::create_container, and xgamesave::create_update.
  • Adds unit tests (null_out_returns_invalidarg_without_leaking) in both dstorage::tests and xgamesave::tests.

How it was tested

  • cargo test --locked -p victory-hle --lib -- modules::dstorage::tests modules::xgamesave::tests (46 passed, 0 failed, 2 ignored benchmarks).
  • cargo xtask policy --staged (asset policy: 2 files ok).

Checked for overlap

  • Searched open and closed PRs on trustno1-coder/VIctory-NVIDIA for create_status_array, new_queue, create_container, create_update, E_INVALIDARG dstorage, and E_INVALIDARG xgamesave; no existing PR addresses these null-out leaks.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554721221 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3154). Originally posted by [RanoGames](https://github.com/RanoGames) on 2026-11-29T20:20:34Z. --- ## What it changes - Adds early `out.is_null()` checks returning `E_INVALIDARG` before allocating heap objects, Win32 events, or scheduler lanes in `dstorage::create_status_array`, `dstorage::new_queue`, `xgamesave::create_container`, and `xgamesave::create_update`. - Adds unit tests (`null_out_returns_invalidarg_without_leaking`) in both `dstorage::tests` and `xgamesave::tests`. ## How it was tested - `cargo test --locked -p victory-hle --lib -- modules::dstorage::tests modules::xgamesave::tests` (46 passed, 0 failed, 2 ignored benchmarks). - `cargo xtask policy --staged` (`asset policy: 2 files ok`). ## Checked for overlap - Searched open and closed PRs on `trustno1-coder/VIctory-NVIDIA` for `create_status_array`, `new_queue`, `create_container`, `create_update`, `E_INVALIDARG dstorage`, and `E_INVALIDARG xgamesave`; no existing PR addresses these null-out leaks.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3154:upstream-pr/3154'
git switch 'upstream-pr/3154'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3154'
git switch 'upstream-pr/3154'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3154'
git switch 'upstream-pr/3154'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3154'
git switch 'main'
git merge --squash 'upstream-pr/3154'
git switch 'main'
git merge --ff-only 'upstream-pr/3154'
git switch 'main'
git merge 'upstream-pr/3154'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!3154
No description provided.