]> Untitled Git - bdk/commitdiff
Merge bitcoindevkit/bdk#2180: fix(chain): prevent integer overflow in `SpkIterator...
authormerge-script <hello@evanlinjin.me>
Thu, 23 Apr 2026 15:41:11 +0000 (15:41 +0000)
committermerge-script <hello@evanlinjin.me>
Thu, 23 Apr 2026 15:41:11 +0000 (15:41 +0000)
b340e96f0221f6c3088fe5daf2b87c56b3bf4010 fix(chain): prevent integer overflow in `SpkIterator::new_with_range` (Elias Rohrer)

Pull request description:

  ### Description

  The start and end bound calculations used unchecked addition which
  overflows when given `u32::MAX`, causing the iterator to silently produce
  wrong results (e.g., an empty iterator for `0..=u32::MAX` in release
  mode). Use `saturating_add` to handle the boundary correctly.

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

ACKs for top commit:
  luisschwab:
    ACK b340e96f0221f6c3088fe5daf2b87c56b3bf4010

Tree-SHA512: f28ebcdb8f8b269d64c4d7bb4e38e8fcdc85864c35b0c287bc0d41d740d6b78bd2491533585f85805cc4f1c63ce4024c677081e7fa283f8f1ad0e18d0728d44f


Trivial merge