diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-06-03 08:53:01 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-06-03 08:53:06 +0200 |
commit | a9435e34457e0bfebd22e574fe63428537948aeb (patch) | |
tree | e38a58536df013a0852f23bba25ae6061c7bfbf1 /src/test/fuzz | |
parent | 0011167191917ccb86c9f3986dc08dae8c754119 (diff) | |
parent | 37371268d14ed6d5739af5b65d8bdb38b0e8dda2 (diff) | |
download | bitcoin-a9435e34457e0bfebd22e574fe63428537948aeb.tar.xz |
Merge bitcoin/bitcoin#22065: Mark `CheckTxInputs` `[[nodiscard]]`. Avoid UUM in fuzzing harness `coins_view`.
37371268d14ed6d5739af5b65d8bdb38b0e8dda2 Mark `CheckTxInputs` `[[nodiscard]]` (out-param `txfee` only set if call is successful). Avoid UUM in fuzzing harness `coins_view`. (practicalswift)
Pull request description:
Mark `CheckTxInputs` `[[nodiscard]]` (out-param `txfee` only set if call is successful).
Avoid use of uninitialised memory (UUM) in fuzzing harness `coins_view`.
ACKs for top commit:
MarcoFalke:
review ACK 37371268d14ed6d5739af5b65d8bdb38b0e8dda2
Tree-SHA512: edada5b2e80ce9ad3bd57b4c445bedefffa0a2d1cc880957d6848e4b7d9fc1ce036cd17f8b18bc03a36fbf84fc29c166cd6ac3dfbfe03e69d6fdbda13697754d
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/coins_view.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp index 878b5a27da..b509ee0b26 100644 --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -236,8 +236,9 @@ FUZZ_TARGET_INIT(coins_view, initialize_coins_view) // It is not allowed to call CheckTxInputs if CheckTransaction failed return; } - (void)Consensus::CheckTxInputs(transaction, state, coins_view_cache, fuzzed_data_provider.ConsumeIntegralInRange<int>(0, std::numeric_limits<int>::max()), tx_fee_out); - assert(MoneyRange(tx_fee_out)); + if (Consensus::CheckTxInputs(transaction, state, coins_view_cache, fuzzed_data_provider.ConsumeIntegralInRange<int>(0, std::numeric_limits<int>::max()), tx_fee_out)) { + assert(MoneyRange(tx_fee_out)); + } }, [&] { const CTransaction transaction{random_mutable_transaction}; |