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.
This commit is contained in:
MarcoFalke
2021-04-28 20:48:10 +02:00
parent fae2c8bc54
commit fab646b8ea
2 changed files with 9 additions and 7 deletions

View File

@@ -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()};