fix(savedata): return parameter error on null arguments in getMountInfo and getParam #7144

Merged
voidlakhan merged 1 commit from upstream-pr/7144 into main 2026-10-17 20:46:38 +00:00
voidlakhan commented 2026-10-17 13:47:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by voidlakhan on 2026-10-17T13:47:26Z.


What

In libSceSaveData.native, return SAVE_DATA_ERROR_PARAMETER (0x809F0000) when null pointer arguments are passed to sceSaveDataGetMountInfo and sceSaveDataGetParam rather than throwing C++ runtime exceptions across the guest ABI boundary. Added regression tests covering null argument validation, unmounted mount points, buffer bounds, and the optional null got_size output parameter.

Tested

Windows 10 x64, MinGW GCC 15.2.0:

  • guest_savedata_search: Passed
  • guest_savedata_delete: Passed
  • guest_savedata_convert: Passed
  • guest_savedata_mount_status: Passed (covers new unmounted, null parameter, and null got_size tests)
  • guest_savedata_ps4: Passed
  • guest_savedata_cancel: Passed
  • guest_savedata_dialog: Passed
  • python tools/check_conventions.py --base upstream/main: Passed
  • git diff --check: Clean

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:4900581059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7144). Originally posted by [voidlakhan](https://github.com/voidlakhan) on 2026-10-17T13:47:26Z. --- ### What In `libSceSaveData.native`, return `SAVE_DATA_ERROR_PARAMETER` (`0x809F0000`) when null pointer arguments are passed to `sceSaveDataGetMountInfo` and `sceSaveDataGetParam` rather than throwing C++ runtime exceptions across the guest ABI boundary. Added regression tests covering null argument validation, unmounted mount points, buffer bounds, and the optional null `got_size` output parameter. ### Tested Windows 10 x64, MinGW GCC 15.2.0: - `guest_savedata_search`: Passed - `guest_savedata_delete`: Passed - `guest_savedata_convert`: Passed - `guest_savedata_mount_status`: Passed (covers new unmounted, null parameter, and null got_size tests) - `guest_savedata_ps4`: Passed - `guest_savedata_cancel`: Passed - `guest_savedata_dialog`: Passed - `python tools/check_conventions.py --base upstream/main`: Passed - `git diff --check`: Clean ### 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
github-actions[bot] commented 2026-10-17 14:34:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T14:34:58Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestSaveDataMountStatus.cpp
PR 6447 core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235150270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7144#issuecomment-6235150270). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T14:34:58Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestSaveDataMountStatus.cpp` | | [PR 6447](https://www.github.com/boykopovar/AnyPS5/pull/6447) | `core/libs/prx/libSceSaveData.native/Export.cpp`<br>`docs/dev/debt/libSceSaveData.native.md` |
voidlakhan commented 2026-10-17 14:39:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by voidlakhan on 2026-10-17T14:39:48Z.


Manually reviewed the shared files against the conflicting PRs:

  • #6044: Touches CMake test labeling and does not collide with the mount status test logic in GuestSaveDataMountStatus.cpp.
  • #6447: Modifies sceSaveDataCancel and sceSaveDataPrepareForTransferring (lines 880+) and the Unknown function info debt section; it does not overlap with sceSaveDataGetMountInfo or sceSaveDataGetParam (lines 404–438) or the Functional debt entry.

Confirmed there is zero code overlap with either PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235201629 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7144#issuecomment-6235201629). Originally posted by [voidlakhan](https://github.com/voidlakhan) on 2026-10-17T14:39:48Z. --- Manually reviewed the shared files against the conflicting PRs: - **#6044**: Touches CMake test labeling and does not collide with the mount status test logic in `GuestSaveDataMountStatus.cpp`. - **#6447**: Modifies `sceSaveDataCancel` and `sceSaveDataPrepareForTransferring` (lines 880+) and the *Unknown function info* debt section; it does not overlap with `sceSaveDataGetMountInfo` or `sceSaveDataGetParam` (lines 404–438) or the *Functional* debt entry. Confirmed there is zero code overlap with either PR.
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!7144
No description provided.