loader: ignore incomplete relocation entries #406
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/406"
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 lordon1a on 2026-11-24T02:58:17Z.
AI-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)Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T02:58:29Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:23:21Z.
Review: APPROVED
Tested
b33c704on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed), includingignores_an_incomplete_relocation_entry.SizeOfBlock,step_by(2)reached an entry whose second byte lay past the block. Rejecting odd sizes alongside< 8and the end bound closes that.breaks rather than skipping the block, so a malformed block ends relocation parsing. That matches how the other malformed cases are already handled..relocand uses no title data.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:34:48Z.
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