Skip to content

Commit 8ac7997

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24196: Fix integer sanitizer suppressions in validation.cpp
fac6205 Fix integer sanitizer suppressions in validation.cpp (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. Fix it with a refactor and remove the suppression. ACKs for top commit: hebasto: ACK fac6205, I have reviewed the code and it looks OK, I agree it can be merged. prayank23: Code Review ACK bitcoin/bitcoin@fac6205 Tree-SHA512: efc5b9887cb2e207033b264ebf425bae5ff013e909701c049aea5d79a21f10495826e962d171b3d412717cbf0a4723e5124133b5401b35a73915212e85e91020
2 parents b7942c9 + fac6205 commit 8ac7997

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/validation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,8 +1787,9 @@ DisconnectResult CChainState::DisconnectBlock(const CBlock& block, const CBlockI
17871787
error("DisconnectBlock(): transaction and undo data inconsistent");
17881788
return DISCONNECT_FAILED;
17891789
}
1790-
for (unsigned int j = tx.vin.size(); j-- > 0;) {
1791-
const COutPoint &out = tx.vin[j].prevout;
1790+
for (unsigned int j = tx.vin.size(); j > 0;) {
1791+
--j;
1792+
const COutPoint& out = tx.vin[j].prevout;
17921793
int res = ApplyTxInUndo(std::move(txundo.vprevout[j]), view, out);
17931794
if (res == DISCONNECT_FAILED) return DISCONNECT_FAILED;
17941795
fClean = fClean && res != DISCONNECT_UNCLEAN;

test/sanitizer_suppressions/ubsan

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ unsigned-integer-overflow:pubkey.h
5757
unsigned-integer-overflow:script/interpreter.cpp
5858
unsigned-integer-overflow:txmempool.cpp
5959
unsigned-integer-overflow:util/strencodings.cpp
60-
unsigned-integer-overflow:validation.cpp
6160
implicit-integer-sign-change:addrman.h
6261
implicit-integer-sign-change:bech32.cpp
6362
implicit-integer-sign-change:compat/stdin.cpp

0 commit comments

Comments
 (0)