diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2023-10-19 15:49:04 +0200 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2023-10-20 22:53:07 +0200 |
commit | f6213929c519d0e615cacd3d6f479f1517be1662 (patch) | |
tree | fd59989141f5422f8ad6b0ff669d41ceb2dcf674 /src/validation.cpp | |
parent | 66865446a771327be9e972cdaf01154ea1bdff6d (diff) | |
download | bitcoin-f6213929c519d0e615cacd3d6f479f1517be1662.tar.xz |
assumeutxo: Check deserialized coins for out of range values
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 2600f0f9fe..a6cab6b095 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5399,6 +5399,11 @@ bool ChainstateManager::PopulateAndValidateSnapshot( coins_count - coins_left); return false; } + if (!MoneyRange(coin.out.nValue)) { + LogPrintf("[snapshot] bad snapshot data after deserializing %d coins - bad tx out value\n", + coins_count - coins_left); + return false; + } coins_cache.EmplaceCoinInternalDANGER(std::move(outpoint), std::move(coin)); |