XGameSave: decode %XX in save file names without slicing the name (#325) #457
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!457
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/457/head"
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?
@raulmesa96 on GitHub · 2026-11-24 00:32 UTC · original
raulmesa96:xgamesave-dec-no-panic→main· +25 −2 · 1 files · 1 commits · closed without mergingdecingamesave.rssliced the save file name by byte index after a%; a name with a multi-byte character right after%xpanicked inside anextern "system"call and aborted the process. It now reads the two digits as bytes, and both must be hex digits (so%+1/%-1are no longer decoded). Names XCL writes itself (enc) decode as before.Fixes #325
What is in it
decreads the escape's digits as bytes –crates/xcl/src/hle/xgameruntime/gamesave.rsdec_keeps_percent_not_followed_by_two_hex_digits(panicked withend byte index 3 is not a char boundarybefore the fix) – same fileTested
x86_64-pc-windows-msvc, debugaebea99onmaina6f5f7a, clean treecargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 677 passed, 0 failed, 41 ignored (thexcllib: 637 passed, 0 failed, 21 ignored)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)cargo test -p xcl --lib gamesave: 11 passed, 0 failedRegression run
scripts/smoke.ps1on. The change is limited todec(decoding save file names) and is covered by the unit tests and the full suite above; I would be grateful if someone with a title could add the twoxcl-smokeblocks.Not tested
AI use
🤖 Generated with Claude Code
`dec` sliced `&file[i + 1..i + 3]` by byte index, so a name in the save folder with '%', an ASCII byte and then a multi-byte character (e.g. "%aé", copied there by hand or by another tool) panicked on a char boundary. `dec` runs during enumeration and reads from `extern "system"` functions, where the panic aborts the process. The two digits are now read as bytes and must both be hex digits, which also stops `from_str_radix` from taking a sign ("%+1" was decoded as 0x01). Fixes #325 Co-Authored-By: Claude Opus 5.5 <[email protected]>@raylitebull on GitHub · 2026-11-24 10:44 UTC · original
Closing as a duplicate of #442 / #448 for #325, which pass the
PR descriptioncheck (whereas this PR failsPR description).Pull request closed