Repository navigation
Conversation
…icing the str
`dec` turned "%XX" back into a byte with `u8::from_str_radix(&file[i + 1..i + 3], 16)`.
Slicing the name at byte offsets panics when a multi-byte character follows the
hex digit ("%aé": "end byte index 3 is not a char boundary"), and `dec` runs on every
folder and file name of the save provider from `extern "system"` entry points, where
the panic cannot unwind: XGameSaveEnumerateContainerInfo over such a folder ends the
title with 0xC0000409. XCL's own `enc` never writes such a name; a folder restored
from a backup or placed by hand can have one. `from_str_radix` also took a sign, so
"%+1" decoded to the byte 1.
The two characters after "%" are now read as bytes and must both be hex digits;
anything else stays as it is. Fixes xcl-dev#325.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Open
Rednaxeh
marked this pull request as ready for review
November 24, 2026 10:20
This was referenced Nov 24, 2026
Collaborator
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.
decingamesave.rsturned%XXback into a byte by slicing the name at byte offsets and parsing withfrom_str_radix. A folder or file name with%, a hex digit and then a multi-byte character (%aé) made the slice end inside the character and panic;decruns on every name in the save provider's folder fromextern "system"entry points, so the panic cannot unwind andXGameSaveEnumerateContainerInfoended the title with0xC0000409. XCL'sencnever writes such a name, but a save folder restored from a backup or edited by hand can hold one.from_str_radixalso accepted a sign, so%+1decoded to the byte 1. Fixes #325.What is in it
crates/xcl/src/hle/xgameruntime/gamesave.rs:decreads the two bytes after%and decodes them only when both are hex digits; anything else is kept as it is. Two tests in the file'smod tests:dec_keeps_a_percent_without_two_hex_digits(%aé,%+1, a trailing%, and anenc/decround trip) anda_container_folder_named_percent_then_multibyte_is_enumerated(a hand-placed%aécontainer folder goes throughXGameSaveEnumerateContainerInfo).Tested
stable-x86_64-pc-windows-msvc, debug (release for the regression run); DXC 1.9.2602.17.main'sdec):dec_keeps_a_percent_without_two_hex_digitspanics atgamesave.rs:100:52(end byte index 3 is not a char boundary; it is inside 'é');a_container_folder_named_percent_then_multibyte_is_enumeratedaborts the test process (thread caused non-unwinding panic. aborting., exit code0xC0000409).cargo test -p xcl --lib -- hle::xgameruntime::gamesave::: 12 passed, 0 failed..\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4) withXCL_REQUIRE_GPU=wave64,mesh: 672 passed, 0 failed, 41 ignored, 0 SKIPPED.Regression run
scripts/smoke.ps1 -Game <folder>on a retail title, release builds, no uncommitted changes, one after the other on the machine above (a warm-up run ofmainfirst, not shown). Thegpu:line names the wrong adapter (the script's known issue); the GPU was the RX 7800 XT. Both blocks unedited.main3516080:this PR's head
e310370:Not tested
AI use
🤖 Generated with Claude Code