HLE: a '>' in a quoted manifest attribute does not end its tag #359
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/359"
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?
Imported from Marvisak/VIctory. Originally posted by Dufftwt on 2026-11-24T02:34:36Z.
What's wrong
runtime::elementsreadsMicrosoftGame.configto get the title id (Game/TitleId) and the storage quota (Game/PersistentLocalStorage/SizeMB). It ends every tag at the tag's first>.XML allows
>unescaped inside an attribute value (XML 1.0 §3.1:AttValue ::= '"' ([^<&"] | Reference)* '"'). So a manifest with, say:has its
ShellVisualstag cut short atA. The/>that closes the element is never seen, the element stays open, and every element after it is read as its child (Game/ShellVisuals/TitleId).Title::from_manifestthen finds no title id and no quota.run.rsgoes on with title id00000000and a 0-byte storage quota: the title's storage, saves and temporary files go underdata/00000000/, with no warning. Only thetitle 00000000line in the console hints at it.What the fix does
A new helper,
tag_end, ends a tag at the first>that is outside a"…"or'…'attribute value. Comments and CDATA sections are handled as before.How it behaves after the fix
Manifests whose attribute values contain
>give their real title id and storage quota. Manifests without one are read exactly as before.Tests
a_quoted_angle_bracket_does_not_end_its_taghas a>in a double-quoted and in a single-quoted attribute value beforeTitleId. It expects(0x639AA8DD, 64 MiB).I ran
cargo test --workspaceon GitHub'swindows-latestwith Rust 1.98.1 fromrust-toolchain.toml:victory-hlehas 87 passed, the other crates have 0 failed.main: it fails with title id and quota(0, 0)instead of(0x639AA8DD, 64 MiB).--test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (#181, #244).Not tested: a real title's manifest with such a value.
Related: #112 and #337 also edit this file, a few lines further down. Neither conflicts with this change.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:27:11Z.
Tested PR #359 at head
d549b6397e3f40e77f9da670344aa15f12b26abb(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged atd549b6397e3f40e77f9da670344aa15f12b26abb.cargo test --locked -p victory-hle a_quoted_angle_bracket_does_not_end_its_tag— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 86 filtered out; finished in 0.00s ); cases: runtime::tests::a_quoted_angle_bracket_does_not_end_its_tag.Behavior covered: Checks quoted angle brackets do not terminate manifest tags and title/store/quota fields still parse.
Code: crates/victory-hle/src/runtime.rs
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:03:16Z.
Review: APPROVED
Tested
d549b63on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed).>in an attribute value, so the oldfind('>')was wrong for any manifest with one.tag_endtracks"and'and only ends the tag on an unquoted>.tag_end(the<!--and<![CDATA[arms), so an apostrophe in a comment can't start a "quote".<?xml version="1.0"?>and similar declarations have balanced quotes.tag_endat all.No issues found.
AI-assisted (Claude Code).