Skip to content

Conversation

hebasto and others added 8 commits October 28, 2022 17:49
sendall should be using a bitwise AND for sendall's IsMine check rather
than an equality as IsMine will never return ISMINE_ALL.

Github-Pull: bitcoin#26344
Rebased-From: 6bcd7e2
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 bitcoin#26274.

Github-Pull: bitcoin#26275
Rebased-From: addf9d6
…s 2147483647

This test would cause a crash in bitcoind (see bitcoin#26274) if the fix given in the
previous commit was not applied.

Github-Pull: bitcoin#26275
Rebased-From: 9153ff3
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK d570190, I've cherry-picked commits manually and got zero diff with this PR branch.

@fanquake fanquake requested a review from instagibbs October 28, 2022 12:51
@instagibbs
Copy link
Member

ACK d570190

applied locally to 24.x, diff matches

@fanquake fanquake merged commit 2e8880a into bitcoin:24.x Oct 31, 2022
@fanquake fanquake deleted the 24_x_rc3 branch October 31, 2022 15:05
@bitcoin bitcoin locked and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants