Skip to content

Commit f7a3647

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24227: Fix unsigned integer overflow in LoadMempool
fadcd03 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 bitcoin/bitcoin@fadcd03 Tree-SHA512: 9fb2f3d49008a59cd45b7c17be0c88c04e61183197c11c8176865af5532c8d0c940db49a351dd0fc75e1d7fd8678c3b816d34cfca170dc6b9cf8f37fdf1c8cae
2 parents fa65f26 + fadcd03 commit f7a3647

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,8 @@ bool LoadMempool(CTxMemPool& pool, CChainState& active_chainstate, FopenFn mocka
44934493
}
44944494
uint64_t num;
44954495
file >> num;
4496-
while (num--) {
4496+
while (num) {
4497+
--num;
44974498
CTransactionRef tx;
44984499
int64_t nTime;
44994500
int64_t nFeeDelta;

0 commit comments

Comments
 (0)