From fa2630328687645fbc7dd1ea46aac32514025715 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 24 Dec 2020 14:16:46 +0100 Subject: fuzz: Check that NULL_DATA is unspendable --- src/test/fuzz/script.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index 892af655f6..f43689290a 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -72,6 +72,13 @@ FUZZ_TARGET_INIT(script, initialize_script) TxoutType which_type; (void)IsStandard(script, which_type); + if (which_type == TxoutType::NULL_DATA) { + assert(script.IsUnspendable()); + } + if (script.IsUnspendable()) { + assert(which_type == TxoutType::NULL_DATA || + which_type == TxoutType::NONSTANDARD); + } (void)RecursiveDynamicUsage(script); @@ -82,7 +89,6 @@ FUZZ_TARGET_INIT(script, initialize_script) (void)script.IsPayToScriptHash(); (void)script.IsPayToWitnessScriptHash(); (void)script.IsPushOnly(); - (void)script.IsUnspendable(); (void)script.GetSigOpCount(/* fAccurate= */ false); (void)FormatScript(script); -- cgit v1.2.3