pe: bound data directories to the optional header #396
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!396
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/396/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:54 UTC · original
fix/pe-data-dir-bounds→main· +37 −4 · 1 files · 1 commits · closed without mergingAI-assisted.
Problem
\ictory_pe::layout::data_directory_offset\ checked \index < NumberOfRvaAndSizes, but did not verify that the requested 8-byte data directory entry actually fits within \IMAGE_FILE_HEADER::SizeOfOptionalHeader\ and the backing file slice. A truncated PE image or inflated \NumberOfRvaAndSizes\ could return an out-of-bounds offset past the optional header or file end.
Fix
Verification
@jeremygold02 on GitHub · 2026-11-24 04:28 UTC · original
Thanks @lordon1a for bounding PE data-directory reads. I tested head
10e9f56a50214df67dca98b19daac0d8e9b04075with:Result: 1 passed, 0 failed (7 filtered out). The synthetic layout regression test checks that directory entries stay within both the optional-header bounds and the file bounds. It covers parser bounds, not loading a real title image.
Pull request closed