Skip to content

Port upstream #359: a '>' in a quoted manifest attribute does not end its tag - #38

Merged
DesertGamer merged 1 commit into
DesertGamer:mainfrom
lcg007xd-c:port/upstream-359-manifest-quote
Nov 25, 2026
Merged

DesertGamer merged 1 commit into
DesertGamer:mainfrom
lcg007xd-c:port/upstream-359-manifest-quote

Conversation

@lcg007xd-c

Copy link
Copy Markdown
Contributor

What this changes

This ports Marvisak/VIctory#359 by Duff. It is cherry-picked with -x, so the commit keeps their authorship.

The MicrosoftGame.config reader in crates/viport-hle/src/runtime.rs (elements) ends a tag at its first >. XML allows an unescaped > inside an attribute value, so a value such as DefaultDisplayName="A > B" cuts the tag short. Its /> is never seen, the element stays open, and every element after it is read as its child. Game/TitleId and Game/PersistentLocalStorage/SizeMB are then not found. The title runs as id 00000000 with no storage quota, and its saves and temporary files go into that folder, with no warning.

The fix adds tag_end, which finds the first > outside quotes, plus #359's test.

VIPort has the upstream merge of #359 in its history, but the change is not in the tree (main still has rest.find('>')). It was lost in a later merge.

Checked

  • No game data of any kind (files, extracts, screenshots, dumps, saves): see docs/asset-policy.md (the test manifest is synthetic)
  • No binary files or archives
  • No new dependency, build.rs, git hook, .cargo config, CI change or script (or an issue explains why)
  • No download, no started program, no network connection added (or an issue explains why)
  • cargo test --workspace passes (not run, see below)
  • cargo clippy --workspace --all-targets --locked -- -D warnings passes (for viport-hle, with CI: clear the clippy errors that keep main red since a3e7f17 #21 merged in locally)
  • The code I wrote is formatted with rustfmt; I did not reformat lines I did not change

What I ran

viport-hle builds only for Windows. On Linux I compiled Title, field_text, elements (and tag_end) from main and from this branch side by side. Then I parsed the test's manifest with both:

main:  id=00000000 storage_bytes=0
fixed: id=639AA8DD storage_bytes=67108864

cargo clippy -p viport-hle --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with #21 merged in: clean.

Not run: cargo test -p viport-hle (Windows only). The new test, a_quoted_angle_bracket_does_not_end_its_tag, will run in the Windows CI test step.

Overlaps

None. No open PR touches viport-hle/src/runtime.rs.

🤖 Generated with Claude Code

The MicrosoftGame.config reader ended a tag at its first '>', but XML
allows '>' unescaped inside an attribute value. A value with one
(DefaultDisplayName="A > B") cut the tag short: its '/>' was never
seen, so the element stayed open and every element after it was read
as its child. Game/TitleId and the storage quota were then not found,
and the title ran as id 00000000 with no storage quota, its saves and
temporary files in that folder, without a warning.

A tag now ends at the first '>' outside quotes.

(cherry picked from commit d549b63)
@DesertGamer
DesertGamer merged commit e6c0fbf into DesertGamer:main Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants