diff options
author | muxator <antonio.muci@bancaditalia.it> | 2022-10-06 22:17:49 +0200 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-10-28 18:00:37 +0800 |
commit | bf2bf73bcbc5277074f1211c20b71995a175c314 (patch) | |
tree | a43288f4aab8cae826bb2af6c8ec7e024cd2fa63 /build-aux | |
parent | b04f5f960893983400e07b96dbe9fe68383a21d2 (diff) | |
download | bitcoin-bf2bf73bcbc5277074f1211c20b71995a175c314.tar.xz |
rpc: fix crash in deriveaddresses when derivation index is 2147483647
2147483647 is the maximum positive value of a signed int32, and - currently -
the maximum value that the deriveaddresses bitcoin RPC call accepts as
derivation index due to its input validation routines.
Before this change, when the derivation index (and thus range_end) reached
std::numeric_limits<int_32_t>::max(), the "i" variable in the for cycle (which
is declared as int, and as such 32 bits in size on most platforms) would be
incremented at the end of the first iteration and then warp back to
-2147483648. This caused SIGABRT in bitcoind and a core dump.
This change assigns "i" an explicit size of 64 bits on every platform,
sidestepping the problem.
Fixes #26274.
Github-Pull: #26275
Rebased-From: addf9d6502db12cebcc5976df3111cac1a369b82
Diffstat (limited to 'build-aux')
0 files changed, 0 insertions, 0 deletions