HLE: require two hex digits in percent escapes #480
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!480
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/480/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?
@enzoduarte1 on GitHub · 2026-11-24 03:53 UTC · original
enzoduarte1:hle/percent-decode-hex-digits→main· +12 −0 · 1 files · 1 commits · merged 2026-11-25 00:11 UTCWhat
media::percent_decodeusedu8::from_str_radix(.., 16)directly on the two bytes after%. That parser accepts a leading+, so afile:URL such asfile:///C:/a%+1.mp4decoded%+1into byte0x01instead of leaving the escape literal.The decoder now requires both characters to be ASCII hex digits before parsing. Real escapes (
%20,%FF) still decode; malformed ones (%+1,%2,%%20) are copied verbatim. Tests cover those cases.Tested
x86_64-pc-windows-gnu(no MSVC linker on this machine).cargo test -p victory-hle --lib media::: 3 passed.cargo test --workspace --exclude victory-loader -- --test-threads=1: all suites passed.cargo clippy -p victory-hle --all-targets -- -A clippy::field_reassign_with_default -D warnings: clean. The allowed lint is the pre-existing warning fixed by PR #355.rustfmt --edition 2024 --check crates/victory-hle/src/modules/media.rsandgit diff --check: clean.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADflag, which MinGW rejects here; the same failure occurs on unmodifiedmain.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).@jeremygold02 on GitHub · 2026-11-24 17:35 UTC · original
Verification at
75fe6c02b278f18eab33ad893bda1dd68d176287:cargo test --locked -p victory-hle --lib percent_decode_requires_two_hex_digits -- --test-threads=1passed (1 passed, 0 failed). The test covers valid%20, signed%+1, incomplete%2, overlapping%%20, and non-hex%2Gescapes; malformed escapes remain literal while later valid escapes still decode.This verification was AI-assisted.