fix(libSceSaveData.native): return SAVE_DATA_ERROR_PARAMETER on null argument in sceSaveDataConvert #11083

Merged
slopgobblercobbler merged 1 commit from upstream-pr/11083 into main 2026-10-27 15:21:12 +00:00
slopgobblercobbler commented 2026-10-25 17:18:31 +00:00 (Migrated from github.com)

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


What

  • Validates null pointer arguments in sceSaveDataConvert (convert helper) and returns SAVE_DATA_ERROR_PARAMETER when param == nullptr || param->dir_name == nullptr instead of throwing a C++ exception.
  • Adds test coverage in core/libs/tests/GuestSaveDataConvert.cpp asserting sceSaveDataConvert(nullptr) == SaveDataErrorParameter and sceSaveDataConvert(&nullDir) == SaveDataErrorParameter.
  • 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/GuestSaveDataConvert.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: #11080
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5006912995 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11083). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-10-25T17:18:31Z. --- ### What - Validates null pointer arguments in `sceSaveDataConvert` (`convert` helper) and returns `SAVE_DATA_ERROR_PARAMETER` when `param == nullptr || param->dir_name == nullptr` instead of throwing a C++ exception. - Adds test coverage in `core/libs/tests/GuestSaveDataConvert.cpp` asserting `sceSaveDataConvert(nullptr) == SaveDataErrorParameter` and `sceSaveDataConvert(&nullDir) == SaveDataErrorParameter`. - 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/GuestSaveDataConvert.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: #11080 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 17:19:28 +00:00 (Migrated from github.com)

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

Review: DISMISSED


The code change is small and I found no direct defect on this static pass, but the PR body only names GuestSaveDataConvert.cpp and the convention script; it omits the OS/toolchain and exact build/test command, while hosted feature tests are skipped. Please make that local result reproducible (or state it was not run), and state in the new debt entry that the null-pointer error behavior is an implementation assumption not checked on a PS5. Also coordinate the shared debt-row conflict with #11080 as noted in the comment.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644320733 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11083#pullrequestreview-5644320733). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T17:19:28Z. **Review:** DISMISSED --- The code change is small and I found no direct defect on this static pass, but the PR body only names `GuestSaveDataConvert.cpp` and the convention script; it omits the OS/toolchain and exact build/test command, while hosted feature tests are skipped. Please make that local result reproducible (or state it was not run), and state in the new debt entry that the null-pointer error behavior is an implementation assumption not checked on a PS5. Also coordinate the shared debt-row conflict with #11080 as noted in the comment.
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!11083
No description provided.