diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-09-27 12:39:17 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-11-01 12:25:29 +0100 |
commit | fa4baf0756c792630391ed456aaa15285ad6eb52 (patch) | |
tree | dbc5d78fbcbfb48cade2043c5cd6f9238205babe /src/test/fuzz/script.cpp | |
parent | 077e98c6c20609bff7ecf1c7c9cdb3f4b31bc139 (diff) |
fuzz: Rework ConsumeScript
This should make it easier for the fuzz engine to explore multisig code
paths. See discussion in https://github.com/bitcoin/bitcoin/issues/23105
The downside is that all fuzz inputs that use ConsumeScript are now
invalidated and need to be re-generated.
Another downside may be that most multisig scripts from ConsumeScript are
using likely not fully valid pubkeys.
Diffstat (limited to 'src/test/fuzz/script.cpp')
-rw-r--r-- | src/test/fuzz/script.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index 74c576322a..0979967384 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -41,9 +41,7 @@ void initialize_script() FUZZ_TARGET_INIT(script, initialize_script) { FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); - const std::optional<CScript> script_opt = ConsumeDeserializable<CScript>(fuzzed_data_provider); - if (!script_opt) return; - const CScript script{*script_opt}; + const CScript script{ConsumeScript(fuzzed_data_provider)}; CompressedScript compressed; if (CompressScript(script, compressed)) { |