loader/prepare: use checked arithmetic and block-bounded reads for ba… #532
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by pug205gti6 on 2026-11-25T02:00:45Z.
…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.Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:37:19Z.
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.
Imported from fxceless/victory-fork. Originally posted by Headache3318 on 2026-11-25T09:25:34Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.