Skip to content

add enforce to prevent integer overflow#3512

Merged
kevinbackhouse merged 2 commits intoExiv2:mainfrom
kevinbackhouse:fix-issue-3511
Feb 27, 2026
Merged

add enforce to prevent integer overflow#3512
kevinbackhouse merged 2 commits intoExiv2:mainfrom
kevinbackhouse:fix-issue-3511

Conversation

@kevinbackhouse
Copy link
Copy Markdown
Collaborator

fixes: #3511

@kevinbackhouse
Copy link
Copy Markdown
Collaborator Author

@mergify backport 0.28.x

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Feb 26, 2026

backport 0.28.x

✅ Backports have been created

Details

Cherry-pick of fe0d015 has failed:

On branch mergify/bp/0.28.x/pr-3512
Your branch is up to date with 'origin/0.28.x'.

You are currently cherry-picking commit fe0d0154.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   test/data/issue_3511_poc.eps
	new file:   tests/bugfixes/github/test_issue_3511.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   tests/regression_tests/test_regression_allfiles.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@kevinbackhouse kevinbackhouse marked this pull request as ready for review February 26, 2026 20:50
Copilot AI review requested due to automatic review settings February 26, 2026 20:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds integer overflow protection when processing native preview data in EPS files. The change prevents potential crashes or undefined behavior when the data size is less than the required header offset.

Changes:

  • Added validation check to prevent integer overflow in preview data processing
  • Added regression test for issue 3511 with malformed EPS file
  • Excluded the test file from general regression testing

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/preview.cpp Added enforcement check to validate data size before offset calculation
tests/bugfixes/github/test_issue_3511.py Added test case to verify the fix handles malformed EPS files correctly
tests/regression_tests/test_regression_allfiles.py Excluded the test file from general regression tests
test/data/issue_3511_poc.eps Added proof-of-concept EPS file that triggers the overflow condition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/preview.cpp
@kevinbackhouse kevinbackhouse merged commit eaa9e21 into Exiv2:main Feb 27, 2026
149 of 165 checks passed
@kevinbackhouse kevinbackhouse deleted the fix-issue-3511 branch February 27, 2026 12:01
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.

Integer Underflow in LoaderNative::getData()

3 participants