loader: ignore incomplete relocation entries #406
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!406
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/406/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?
@lordon1a on GitHub · 2026-11-24 02:58 UTC · original
fix/loader-incomplete-relocations→main· +23 −1 · 1 files · 1 commits · closed without mergingAI-assisted.
Problem
In
victory_loader::prepare::dir64_relocations, a base relocation block with an odd byte size (block >= 8, e.g.9) passedblock < 8 || at + block > end, causing(at + 8..at + block).step_by(2)to read a 16-bit relocation entry whose second byte lies outside the declared block.Fix
block.is_multiple_of(2)alongsideblock >= 8andat + block <= endbefore iterating 16-bit relocation entries.prepare::tests::ignores_an_incomplete_relocation_entryverifying that a valid 12-byte block produces the DIR64 entry while a 9-byte block with a trailing incomplete byte is ignored.Verification
cargo xtask policy:151 files okcargo test -p victory-loader --lib:19 passed; 0 failedcargo clippy -p victory-loader --lib --tests -- -D warnings: clean (0 warnings)@jeremygold02 on GitHub · 2026-11-24 04:34 UTC · original
Thanks @lordon1a for rejecting incomplete DIR64 relocation entries. I tested head
b33c704e3335ac2644faafc1ff92bac899e65195with:Result: 1 passed, 0 failed (18 filtered out). The test checks that a valid 12-byte relocation block retains its DIR64 entry while an odd 9-byte block’s trailing incomplete entry is ignored. This is a synthetic relocation-table parser test, not a title load.
Pull request closed