Skip to content

pe: validate offset and size in exception data - #538

Open
Dav1dde wants to merge 2 commits into
m4b:masterfrom
Dav1dde:validate/exception-data
Open

pe: validate offset and size in exception data#538
Dav1dde wants to merge 2 commits into
m4b:masterfrom
Dav1dde:validate/exception-data

Conversation

@Dav1dde

@Dav1dde Dav1dde commented May 26, 2026

Copy link
Copy Markdown

It's possible that pe.exception_data.functions() panics because of an out of bounds error. Size and offset are never validated against the total available data.

This adds a check in the constructor which validates size and offset to make the panic in functions() impossible.

We did observe a few of these panics in the wild: https://sentry-s4s2.sentry.io/share/issue/acd5bd4bf9c5417c809ba5f7bbccd747/

@m4b m4b left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, looks good to me, seems reasonable! cc @kkent030315

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.

2 participants