Repository navigation
Conversation
…king (xcl-dev#325) dec() sliced the &str by byte index, so a name with '%', one ASCII byte and then a multi-byte character (a folder made outside XCL) panicked, and from the extern "system" enumeration calls that aborts the title (0xC0000409). It now decodes %XY from the bytes, only when both are ASCII hex digits, which also stops '%+1' from decoding to 0x01. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested exact head Tested
Not tested
AI use
|
|
Test run of Tested
Review: Duplicate of #514 (open), and #325 has had other PRs too; all decode Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
decinhle/xgameruntime/gamesave.rssliced the&strby byte index. A save name with%, one ASCII byte and then a multi-byte character, such as a folder copied in by hand or restored from a backup, panicked. Becausedecruns from theextern "system"enumeration calls, that aborted the whole title with 0xC0000409 (confirmed on Windows by @jleybourne in the issue). It now decodes%XYfrom the bytes, and only when both are ASCII hex digits. That also stops%+1decoding to 0x01, becausefrom_str_radixaccepted a sign.Fixes #325
What is in it
dec: ahex_digithelper (char::to_digit(16), ASCII only, no sign) instead ofu8::from_str_radixon a slice. Namesencwrites decode as before.dec_keeps_bad_escapes_literal:%a\u{e9},%\u{e9}a,%+1,%-1xand a truncateda%4stay literal,%41%42cand%c3%A9still decode, anddec(enc(name)) == nameholds for multi-byte,%and Windows-special names.enumerating_a_container_with_a_bad_escape_does_not_abort: the issue's repro. A%a\u{e9}container folder is made by hand, thenXGameSaveEnumerateContainerInfolists it.main'sdec, the first test panics at the slice and the second aborts with "thread caused non-unwinding panic"; with this PR both pass.Tested
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 678 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, both "no wave64")cargo test -p xcl --lib gamesave: 12 passedRegression run
main:
PR:
Not tested
AI use