Skip to content

[delta] Add bounds checks for delta image#693

Merged
dgarske merged 4 commits intowolfSSL:masterfrom
danielinux:fix-delta-boundary-checks
Feb 24, 2026
Merged

[delta] Add bounds checks for delta image#693
dgarske merged 4 commits intowolfSSL:masterfrom
danielinux:fix-delta-boundary-checks

Conversation

@danielinux
Copy link
Member

found via Fenrir/M-29

Copilot AI review requested due to automatic review settings February 24, 2026 09:50
Copy link
Contributor

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

Adds source-buffer bounds checks in the delta patch application logic (wb_patch) and introduces unit tests to validate failure behavior on out-of-range source offsets, addressing an issue found via Fenrir/M-29.

Changes:

  • Add bounds validation for source reads in wb_patch() before memcpy() during normal and resume matching.
  • Add new unit tests to ensure wb_patch() returns -1 on invalid source offsets (both header-driven and resume-state driven).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/delta.c Adds runtime bounds checks to prevent reading past src_base/src_size when applying a delta patch.
tools/unit-tests/unit-delta.c Adds two negative tests covering out-of-bounds source offsets during patch application.

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

Copilot AI review requested due to automatic review settings February 24, 2026 15:16
Copy link
Contributor

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


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

@dgarske dgarske merged commit 5a6b8c6 into wolfSSL:master Feb 24, 2026
320 of 325 checks passed
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.

3 participants