fix(json2): return parse error on null text or zero size #7372
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7372"
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 pushkarreddyy on 2026-10-18T03:13:11Z.
What
In NHL 26 (PPSA26785, Discussion #7304), execution halts ~4m56s in (after the legal/licence screen) on an unhandled exception:
_ZN3sce4Json6Parser5parseERNS0_5ValueEPKcmpreviously threw hoststd::invalid_argument("sce::Json::Parser::parse: null text")when passed a null text pointer. The console'slibSceJson2returns an error status rather than throwing host C++ exceptions into the guest runtime, which causes an unhandled abort.This change returns
JsonErrorParse(0x80920101) whentext == nullptr || size == 0, leaving the outputValueuntouched.Tested
core/libs/tests/GuestJson.cppvalidating thatParser::parsewith(nullptr, 0),(nullptr, 10), and("", 0)returns< 0and preserves existingValuecontents.python tools/check_conventions.py --base origin/mainpasses with 0 findings.Checklist
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T03:22:59Z.
Thanks, the fix looks right. One request: please drop the title id from the debt entry, since we keep game titles out of docs (title-specific notes go in the Game bring-up discussion, https://github.com/boykopovar/AnyPS5/discussions/7304 here). For example: "a null text pointer or zero size returns
JsonErrorParse(0x80920101) without modifying the destination Value; whether the console uses a separate parameter error code for a null pointer is unknown."Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T03:32:32Z.
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.
docs/dev/debt/libSceJson2.mdcore/libs/tests/GuestJson.cppcore/libs/prx/libSceJson2/Export.cppdocs/dev/debt/libSceJson2.mddocs/dev/debt/libSceJson2.mdImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T03:34:32Z.
Review: COMMENTED
Small test suggestion: since the PR specifies
JsonErrorParse(0x80920101), could the three new assertions compare the return value toJsonErrorParseinstead of only checking< 0? That would pin the stated error contract and catch a different failure code.Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-18T04:14:37Z.
Done! Dropped the title ID from the debt entry in
docs/dev/debt/libSceJson2.mdand force-pushed the updated commit.Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-18T04:21:49Z.
Updated the three assertions in
GuestJson.cppto verify exact equality withJsonErrorParse(== JsonErrorParse) as suggested by @MarcZX100, and verifiedtools/check_conventions.pypasses cleanly with 0 findings.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:23:24Z.
Thanks for updating the three assertions to compare against
JsonErrorParse, and for removing the title ID from the debt entry. I checked the current diff; those changes address both review points, and I have no further request on this patch.