loader/prepare: use checked arithmetic and block-bounded reads for ba… #532
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!532
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-532"
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?
@pug205gti6 on GitHub · 2026-11-25 02:00 UTC · original
pug205gti6:pr/490-loader-prepare→main· +118 −23 · 1 files · 1 commits · open…se relocations
Fixes unchecked additions and out-of-block reads in
victory-loader's PE preparation pass (crates/victory-loader/src/prepare.rs):dir64_relocations:page + u32::from(e & 0xFFF)panicked in debug builds (and wrapped to a low RVA in release builds) when a relocation page nearu32::MAXoverflowed;start + size,at + 8, andat + blockwere also unchecked andendwas not clamped tobytes.len().(at + 8..at + block).step_by(2)and slicingbytes.get(entry..entry + 2)read one byte pastat + blockinto the next block's header whenblockwas odd. Iteratingbytes[header_end..block_end].as_chunks::<2>().0keeps all reads strictly within the block.write(): checkat + TLS64_ADDRESS_OF_CALLBACKS,tls.directory_rva + TLS64_ADDRESS_OF_CALLBACKS, andat + v.len()withchecked_add.@Revens2 on GitHub · 2026-11-25 07:37 UTC · original
Duplicate of #490: @IlyassRS3 opened this patch 31 minutes earlier, and
gh pr diffreturns the same bytes for both (+118/-23 on 1 file(s), same title).Please continue in #490 so the review history and any test data stay in one place.
Thanks.
@Headache3318 on GitHub · 2026-11-25 09:25 UTC · original
Independent verification: PR #532 docs fix Windows GPU driver install instructions merges cleanly, no conflicts. Single file changed crates/victory-loader/src/prepare.rs +118/-23. Build success. Tests fail with pre-existing E0433 errors for Windows-specific modules, unrelated to PR changes. PR builds cleanly and introduces no new errors. Machine: Arch Linux kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.