fix(libSceSaveData.native): validate null arguments in sceSaveDataDirNameSearchPs4 and sceSaveDataMount #11080

Merged
slopgobblercobbler merged 1 commit from upstream-pr/11080 into main 2026-10-27 07:46:03 +00:00
slopgobblercobbler commented 2026-10-25 17:15:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-10-25T17:15:21Z.


What

  • Validates null pointer arguments in sceSaveDataDirNameSearchPs4 and returns SAVE_DATA_ERROR_PARAMETER instead of throwing a C++ exception.
  • Avoids null pointer dereference in sceSaveDataDirNameSearchPs4 trace log when cond is null.
  • Validates null mount_result in sceSaveDataMount and returns SAVE_DATA_ERROR_PARAMETER instead of forwarding null to sceSaveDataMount3.
  • Updates GuestSaveDataPs4.cpp to expect SAVE_DATA_ERROR_PARAMETER on null pointer inputs.
  • Updates docs/dev/debt/libSceSaveData.native.md to document the null argument handling.

Tested

Ran tools/check_conventions.py --base upstream/main --head HEAD (0 findings). Tested via core/libs/tests/GuestSaveDataPs4.cpp.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5006887201 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11080). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-10-25T17:15:21Z. --- ### What - Validates null pointer arguments in `sceSaveDataDirNameSearchPs4` and returns `SAVE_DATA_ERROR_PARAMETER` instead of throwing a C++ exception. - Avoids null pointer dereference in `sceSaveDataDirNameSearchPs4` trace log when `cond` is null. - Validates null `mount_result` in `sceSaveDataMount` and returns `SAVE_DATA_ERROR_PARAMETER` instead of forwarding null to `sceSaveDataMount3`. - Updates `GuestSaveDataPs4.cpp` to expect `SAVE_DATA_ERROR_PARAMETER` on null pointer inputs. - Updates `docs/dev/debt/libSceSaveData.native.md` to document the null argument handling. ### Tested Ran `tools/check_conventions.py --base upstream/main --head HEAD` (0 findings). Tested via `core/libs/tests/GuestSaveDataPs4.cpp`. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 17:18:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T17:18:46Z.

Review: DISMISSED


I found no code defect in the null checks or trace-safe argument handling on this static pass. The current Tested section only names GuestSaveDataPs4.cpp and the convention script; it omits the OS/toolchain and exact build/test command, while the hosted feature test jobs are skipped. Please make the local test result reproducible (or state it was not run), and update the new debt entry to say the null-pointer error behavior is an implementation assumption and has not been checked on a PS5. The current tests establish the emulator behavior, not the console error contract.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644318549 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11080#pullrequestreview-5644318549). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T17:18:46Z. **Review:** DISMISSED --- I found no code defect in the null checks or trace-safe argument handling on this static pass. The current `Tested` section only names `GuestSaveDataPs4.cpp` and the convention script; it omits the OS/toolchain and exact build/test command, while the hosted feature test jobs are skipped. Please make the local test result reproducible (or state it was not run), and update the new debt entry to say the null-pointer error behavior is an implementation assumption and has not been checked on a PS5. The current tests establish the emulator behavior, not the console error contract.
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
boykopovar/AnyPS5!11080
No description provided.