aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/util.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-28 20:48:10 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-28 20:53:50 +0200
commitfab646b8ea293bb2b03707c6ef6790982625e492 (patch)
treeac66c60c646955dc15a25a5c88d822b92ec14e00 /src/test/fuzz/util.cpp
parentfae2c8bc54e6c0fe69a82bd1b232c52edd1acd34 (diff)
downloadbitcoin-fab646b8ea293bb2b03707c6ef6790982625e492.tar.xz
fuzz: Use correct variant of ConsumeRandomLengthString instead of hardcoding a maximum size
This is technically a breaking change. This allows the fuzz engine to pick the right size, also larger sizes, if needed.
Diffstat (limited to 'src/test/fuzz/util.cpp')
-rw-r--r--src/test/fuzz/util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/fuzz/util.cpp b/src/test/fuzz/util.cpp
index 6966c9b3ae..dc89f25e26 100644
--- a/src/test/fuzz/util.cpp
+++ b/src/test/fuzz/util.cpp
@@ -276,7 +276,7 @@ CScriptWitness ConsumeScriptWitness(FuzzedDataProvider& fuzzed_data_provider, co
return ret;
}
-CScript ConsumeScript(FuzzedDataProvider& fuzzed_data_provider, const size_t max_length, const bool maybe_p2wsh) noexcept
+CScript ConsumeScript(FuzzedDataProvider& fuzzed_data_provider, const std::optional<size_t>& max_length, const bool maybe_p2wsh) noexcept
{
const std::vector<uint8_t> b = ConsumeRandomLengthByteVector(fuzzed_data_provider, max_length);
CScript r_script{b.begin(), b.end()};