Repository navigation
fix(libSceJxr): safely probe the position output of GetPosWS_File and GetPosWS_List - #20814
Merged
oneandonlydean merged 1 commit intoNov 15, 2026
Conversation
… GetPosWS_List Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GetPosWS_FileandGetPosWS_Liststored the stream position straight into the guestpositionpointer. An output pointing at unmapped memory faulted the host.Both now write the position with
GuestCopyOut_nid_no_patch. An unwritable output throws the samestd::invalid_argumentthey 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 matchesGetPosWS_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.
guest_jxr_file_streamandguest_jxr_list_stream: after the existing position checks (0, 9 and 5000, 4097, 8192), a0x10output throwsstd::invalid_argument.guest_jxr,guest_jxr_streamandguest_jxr_image_encodestill pass.FileStream.cppandListStream.cppfrommainwith these tests die with SIGSEGV at address0x10in both tests.git merge-treeis clean againstmainand against feat(libSceJxr): create decoders from files as jxrlib does #20362, feat(libSceJxr): open file streams from the PKFactory slot #19182, fix(libSceJxr): validate guest memory pointers in WMPAlloc and WMPFree #18247 and feat(libSceJxr): implement the PKFormatConverter exports #17400.mainitself ininclude/Api.hpp, a file this PR does not touch.tools/check_conventions.pypasses on the branch and this body.tools/debt_fold.py --checkpasses with the fragment applied.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)