aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-02-09 08:30:34 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-02-09 08:30:38 +0100
commit8ac79973f8e923e9f1f560f4909b912ccea34035 (patch)
tree37ceb2e512b3073da951222d1f86496b95fc5e67 /src
parentb7942c94824e4e06489417ee587d1f3ac631fce0 (diff)
parentfac62056b56e0a28baf0b6f285752d83fbf96074 (diff)
downloadbitcoin-8ac79973f8e923e9f1f560f4909b912ccea34035.tar.xz
Merge bitcoin/bitcoin#24196: Fix integer sanitizer suppressions in validation.cpp
fac62056b56e0a28baf0b6f285752d83fbf96074 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 fac62056b56e0a28baf0b6f285752d83fbf96074, I have reviewed the code and it looks OK, I agree it can be merged. prayank23: Code Review ACK https://github.com/bitcoin/bitcoin/pull/24196/commits/fac62056b56e0a28baf0b6f285752d83fbf96074 Tree-SHA512: efc5b9887cb2e207033b264ebf425bae5ff013e909701c049aea5d79a21f10495826e962d171b3d412717cbf0a4723e5124133b5401b35a73915212e85e91020
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index f2fa1cf8d5..e20e2fe523 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1787,8 +1787,9 @@ DisconnectResult CChainState::DisconnectBlock(const CBlock& block, const CBlockI
error("DisconnectBlock(): transaction and undo data inconsistent");
return DISCONNECT_FAILED;
}
- for (unsigned int j = tx.vin.size(); j-- > 0;) {
- const COutPoint &out = tx.vin[j].prevout;
+ for (unsigned int j = tx.vin.size(); j > 0;) {
+ --j;
+ const COutPoint& out = tx.vin[j].prevout;
int res = ApplyTxInUndo(std::move(txundo.vprevout[j]), view, out);
if (res == DISCONNECT_FAILED) return DISCONNECT_FAILED;
fClean = fClean && res != DISCONNECT_UNCLEAN;