Skip to content

fix(libSceJxr): safely probe the position output of GetPosWS_File and GetPosWS_List - #20814

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/jxr-probe-stream-position-outputs
Nov 15, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/jxr-probe-stream-position-outputs

Conversation

@milescoviello

Copy link
Copy Markdown
Contributor

What

GetPosWS_File and GetPosWS_List stored the stream position straight into the guest position pointer. An output pointing at unmapped memory faulted the host.

Both now write the position with GuestCopyOut_nid_no_patch. An unwritable output throws the same std::invalid_argument they already throw for a null one. That follows the accepted rule for exports whose null argument throws (an unmapped one throws the same way). It also matches GetPosWS_Memory, which already copies its output out and raises an invalid-argument exception for both null and unwritable outputs. The position values and the order of checks are unchanged.

The debt entry goes in a fragment under docs/dev/debt/changes/ and records that console behaviour here is not measured.

Tested

Linux (Ubuntu 26.04.1), GCC 15.2, Release.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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

… GetPosWS_List

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oneandonlydean
oneandonlydean merged commit c20f2f2 into boykopovar:main Nov 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants