diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-02-07 14:06:31 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-02-07 14:06:33 +0100 |
commit | f7a36477a61b3719859ee4bb0795821c2aa6bd16 (patch) | |
tree | 65e775582f5b36417c4f99e59aa5eb2aad4ee2b7 | |
parent | fa65f26f4dd6135abb88410023f5ada753d5b257 (diff) | |
parent | fadcd031390dd4588bbb1c07e5020a7131312050 (diff) | |
download | bitcoin-f7a36477a61b3719859ee4bb0795821c2aa6bd16.tar.xz |
Merge bitcoin/bitcoin#24227: Fix unsigned integer overflow in LoadMempool
fadcd031390dd4588bbb1c07e5020a7131312050 Fix unsigned integer overflow in LoadMempool (MarcoFalke)
Pull request description:
It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file.
This removes one of the two violations.
This should be a refactor.
ACKs for top commit:
prayank23:
Code Review ACK https://github.com/bitcoin/bitcoin/pull/24227/commits/fadcd031390dd4588bbb1c07e5020a7131312050
Tree-SHA512: 9fb2f3d49008a59cd45b7c17be0c88c04e61183197c11c8176865af5532c8d0c940db49a351dd0fc75e1d7fd8678c3b816d34cfca170dc6b9cf8f37fdf1c8cae
-rw-r--r-- | src/validation.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index c12dc9e8b6..f2fa1cf8d5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4493,7 +4493,8 @@ bool LoadMempool(CTxMemPool& pool, CChainState& active_chainstate, FopenFn mocka } uint64_t num; file >> num; - while (num--) { + while (num) { + --num; CTransactionRef tx; int64_t nTime; int64_t nFeeDelta; |