Ava Chow
b388674acf
Merge bitcoin/bitcoin#35872 : rpc: avoid descriptor range counter overflow
...
264555af3c rpc: avoid descriptor range counter overflow (Lőrinc)
143a13fb2b test: characterize descriptor range endpoint (Lőrinc)
Pull request description:
**Problem:** The authenticated `scantxoutset`, `scanblocks`, `getdescriptoractivity`, `utxoupdatepsbt`, and `descriptorprocesspsbt` RPCs share a descriptor expansion helper that iterates inclusive `int64_t` ranges with an `int` counter.
A ranged descriptor with an explicit `[begin, end]` range ending at `2^31 - 1` expands that valid position, then overflows when advancing the counter to exit the loop.
Trap-enabled builds terminate, while other builds invoke undefined behavior.
**Fix:** Use `int64_t` for loop control so the one-past-the-end value is representable and every position passed to `Descriptor::Expand()` remains within its existing `int` range.
Related: [#26275 ](https://github.com/bitcoin/bitcoin/pull/26275 ) fixed the same endpoint overflow in `deriveaddresses`.
ACKs for top commit:
achow101:
ACK 264555af3c
polespinasa:
ACK 264555af3c
sedited:
ACK 264555af3c
Tree-SHA512: 4326182b5897b6f6672e5f7c7296eafdbb6e3b5ed901d61e8fa2cff9b19d372bb8adb88902368dc520ed400e12dd5264ea68677d9ce0feec76fa2ef55fa0d2f4
2026-08-06 13:07:06 -07:00
..
2026-08-05 11:51:29 +02:00
2026-08-04 22:22:56 +02:00
2026-02-18 21:29:07 +01:00
2026-08-04 15:02:39 +01:00
2026-07-24 14:01:06 +01:00
2026-07-12 12:39:54 +02:00
2026-06-26 09:56:01 -07:00
2026-08-03 15:53:09 +01:00
2026-07-29 09:36:13 +02:00
2026-08-03 12:03:56 -07:00
2026-05-28 09:34:12 +01:00
2026-06-23 22:10:34 -04:00
2026-08-03 12:03:56 -07:00
2026-07-24 14:01:06 +01:00
2026-07-24 14:01:06 +01:00
2026-08-03 12:03:56 -07:00
2026-08-06 13:07:06 -07:00
2026-07-29 09:55:39 +02:00
2026-07-23 09:52:01 +01:00
2026-07-24 14:01:06 +01:00
2026-08-06 15:18:54 +01:00
2026-03-30 09:03:06 +02:00
2026-08-05 11:22:34 +02:00
2026-08-05 11:04:17 +02:00
2026-07-24 14:01:06 +01:00
2026-07-14 13:31:49 +02:00
2026-08-05 11:51:29 +02:00
2026-05-16 03:36:51 +10:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2026-05-16 03:36:51 +10:00
2026-07-10 13:33:51 -03:00
2026-07-22 13:54:39 +01:00
2026-02-11 18:18:21 +01:00
2025-12-16 22:21:15 +01:00
2026-05-16 03:36:51 +10:00
2026-06-10 10:32:40 +01:00
2026-06-10 10:32:40 +01:00
2026-06-04 21:58:56 +10:00
2026-01-21 19:40:25 +05:30
2026-06-27 11:26:41 +01:00
2026-06-04 09:23:13 +02:00
2026-07-17 14:01:58 +02:00
2026-04-22 16:46:02 +10:00
2026-03-30 16:34:48 +01:00
2026-05-27 15:48:32 +01:00
2026-07-17 10:57:18 -04:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2026-04-20 08:55:51 +02:00
2026-04-20 08:55:51 +02:00
2026-06-03 13:53:24 -07:00
2026-01-14 23:04:12 +01:00
2026-05-25 18:55:15 -04:00
2026-01-14 23:04:12 +01:00
2026-02-25 14:36:19 -08:00
2026-06-16 10:38:20 +02:00
2026-03-30 16:34:48 +01:00
2026-03-30 16:34:48 +01:00
2026-07-14 13:20:41 -04:00
2026-07-23 09:52:01 +01:00
2026-07-17 22:55:23 -07:00
2026-07-22 12:38:13 -07:00
2025-12-16 22:21:15 +01:00
2026-07-24 14:01:06 +01:00
2026-05-29 11:36:08 +03:00
2026-01-19 12:57:16 +01:00
2025-12-16 22:21:15 +01:00
2026-02-11 18:18:21 +01:00
2026-07-04 11:19:19 -04:00
2026-07-12 12:39:54 +02:00
2026-03-10 16:17:40 +01:00
2026-01-14 23:04:12 +01:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2026-05-16 03:36:51 +10:00
2026-07-02 09:23:48 -04:00
2026-06-11 10:33:03 -07:00
2026-02-11 18:18:21 +01:00
2025-12-16 22:21:15 +01:00
2026-07-24 14:01:06 +01:00
2026-05-16 03:36:51 +10:00
2025-11-20 11:34:21 +09:00
2026-06-22 05:47:00 -04:00
2026-02-27 19:26:08 -04:00
2026-08-01 16:43:57 +01:00
2026-08-01 16:43:57 +01:00
2026-07-23 12:06:32 +02:00
2026-07-23 12:06:32 +02:00
2025-12-16 22:21:15 +01:00
2026-08-03 12:03:56 -07:00
2025-12-16 22:21:15 +01:00
2026-02-11 18:18:21 +01:00
2025-12-16 22:21:15 +01:00
2026-07-29 09:55:39 +02:00
2026-07-29 09:55:39 +02:00
2026-06-23 22:10:34 -04:00
2026-05-16 03:36:51 +10:00
2026-05-27 15:48:32 +01:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2026-02-11 18:18:21 +01:00
2025-12-16 22:21:15 +01:00
2026-06-25 17:34:01 -07:00
2026-06-12 16:06:23 -04:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2026-08-05 21:20:22 -04:00
2026-07-12 09:12:27 +10:00
2026-05-16 03:36:51 +10:00
2025-12-16 22:21:15 +01:00
2026-07-24 14:30:00 -07:00
2026-07-24 14:30:00 -07:00
2026-01-14 23:04:12 +01:00
2026-06-27 11:26:41 +01:00
2026-05-20 13:39:20 +02:00
2026-05-16 03:36:51 +10:00
2026-01-20 23:59:41 +01:00
2025-12-16 22:21:15 +01:00
2026-06-11 21:33:33 +02:00
2026-06-11 21:31:18 +02:00
2025-12-16 22:21:15 +01:00
2026-01-14 23:04:12 +01:00
2026-06-10 10:32:40 +01:00
2026-07-07 16:24:48 +01:00
2026-06-30 14:53:59 -04:00
2025-12-16 22:21:15 +01:00
2026-07-21 18:59:09 +02:00
2026-05-16 23:57:14 -07:00
2026-05-29 11:36:08 +03:00
2026-06-25 17:34:01 -07:00
2026-06-25 17:34:01 -07:00
2026-02-02 17:22:31 +00:00
2026-01-14 23:04:12 +01:00
2026-04-20 11:15:41 +02:00
2025-12-16 22:21:15 +01:00
2026-06-22 05:47:00 -04:00
2025-12-16 22:21:15 +01:00
2025-12-16 22:21:15 +01:00
2026-05-06 11:48:06 -04:00
2026-06-04 21:54:08 +10:00
2026-05-29 11:36:08 +03:00
2025-12-21 10:24:09 +01:00
2025-11-14 01:17:38 +02:00
2026-04-28 10:37:15 +02:00
2026-03-23 15:13:45 +10:00
2026-06-08 19:06:33 +01:00
2026-03-20 15:37:44 +00:00
2026-07-24 14:01:06 +01:00
2026-07-28 13:02:21 +02:00
2026-07-28 13:02:21 +02:00
2026-06-23 16:13:03 -07:00
2026-07-14 13:27:20 -07:00
2026-07-17 11:36:46 +01:00
2026-02-24 10:08:47 -05:00
2026-07-12 09:12:27 +10:00
2026-07-25 12:15:44 +02:00
2026-04-28 18:22:47 +00:00
2025-12-30 12:12:26 -08:00
2025-12-16 22:21:15 +01:00
2026-07-17 19:02:14 -07:00
2026-02-09 17:27:39 +01:00
2026-08-06 11:19:41 +02:00
2026-07-09 16:21:28 +02:00
2026-05-16 03:36:50 +10:00
2026-03-18 13:34:26 +01:00
2025-12-16 22:21:15 +01:00
2025-12-19 16:56:02 +00:00
2026-06-01 09:53:29 -04:00
2025-12-16 22:21:15 +01:00