Skip to content

fix(coff): return error when raw section extent exceeds file bounds - #3060

Open
Yshuro wants to merge 1 commit into
wild-linker:mainfrom
Yshuro:fix/issue-3025
Open

Yshuro wants to merge 1 commit into
wild-linker:mainfrom
Yshuro:fix/issue-3025

Conversation

@Yshuro

@Yshuro Yshuro commented Nov 21, 2026

Copy link
Copy Markdown

When reading COFF section raw data, raw_section_data unchecked addition and slice indexing &self.data[ptr..ptr + size] causes an out-of-bounds panic when ptr + size overflows or extends beyond the object file.

Use checked addition and safe slice indexing (self.data.get(ptr..end)), returning an error diagnostic instead of panicking on malformed inputs.

Fixes #3025.

Signed-off-by: Yshuro <yshuro1080@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed COFF section raw-data extent past EOF causes an out-of-bounds panic

1 participant