fix(npmanager): validate null output pointers #7597
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7597"
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?
Imported from boykopovar/AnyPS5. Originally posted by voidlakhan on 2026-10-18T16:27:01Z.
What
sceNpGetOnlineIdandsceNpGetAccountCountryAunconditionally returnedSCE_NP_ERROR_SIGNED_OUT(0x80550006) without validating their destination pointers, ignoring null arguments.Both functions now validate their output buffer pointers and return
SCE_NP_ERROR_INVALID_ARGUMENT(0x80550003) when passednullptr, matching the existing null-pointer validation pattern used by siblinglibSceNpManagerAPIs (sceNpGetNpId,sceNpGetAccountAge,sceNpGetState,sceNpGetUserIdByAccountId).Added regression tests in
GuestNpManager.cppcovering null argument rejection and preserving unmodified output buffers in signed-out state.Tested
guest_np_manager_tests: 1/1 tests passed.python tools/check_conventions.py --base upstream/main: passed.git diff --check: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T16:36:56Z.
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.
core/libs/tests/GuestNpManager.cppcore/libs/prx/libSceNpManager/Export.cppcore/libs/prx/libSceNpManager/Export.cppcore/libs/tests/GuestNpManager.cppcore/libs/prx/libSceNpManager/Export.cppImported from boykopovar/AnyPS5. Originally posted by voidlakhan on 2026-10-18T16:48:45Z.
Checked the shared files with the referenced pull requests:
core/libs/tests/GuestNpManager.cpp): Adds tests forsceNpGetAccountIdAandsceNpGetState; does not testsceNpGetAccountCountryAorsceNpGetOnlineId.core/libs/tests/GuestNpManager.cpp): Reorganizes test paths into subdirectories; does not modifylibSceNpManagertest assertions.core/libs/prx/libSceNpManager/Export.cpp): ImplementssceNpSetContentRestrictionand messaging stubs; does not touchsceNpGetOnlineIdorsceNpGetAccountCountryA.There is no functional or export overlap with any open PR.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T23:19:16Z.
Checked against shadPS4 (null output pointer returns INVALID_ARGUMENT before the signed-out check in both functions) and the new test pins null -> INVALID_ARGUMENT and untouched output; merged.