Skip to content

Commit 1c5e0cc

Browse files
author
MarcoFalke
committed
Merge #17274: tests: Fix fuzzers eval_script and script_flags by re-adding ECCVerifyHandle dependency
9cae3d5 tests: Add fuzzer initialization (hold ECCVerifyHandle) (practicalswift) Pull request description: The fuzzers `eval_script` and `script_flags` require holding `ECCVerifyHandle`. This is a follow-up to #17235 which accidentally broke those two fuzzers. Sorry about the temporary breakage my fuzzing friends: it took a while to fuzz before reaching these code paths. That's why this wasn't immediately caught. Sorry. Top commit has no ACKs. Tree-SHA512: 67ebb155ba90894c07eac630e33f2f985c97bdf96dc751f312633414abeccdca20315d7d8f2ec4ee3ac810b666a1e44afb4ea8bc28165151cd51b623f816cac2
2 parents feb1a8c + 9cae3d5 commit 1c5e0cc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/test/fuzz/eval_script.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <pubkey.h>
56
#include <script/interpreter.h>
6-
#include <test/fuzz/FuzzedDataProvider.h>
77
#include <test/fuzz/fuzz.h>
8+
#include <test/fuzz/FuzzedDataProvider.h>
9+
#include <util/memory.h>
810

911
#include <limits>
1012

13+
void initialize()
14+
{
15+
static const auto verify_handle = MakeUnique<ECCVerifyHandle>();
16+
}
17+
1118
void test_one_input(const std::vector<uint8_t>& buffer)
1219
{
1320
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());

src/test/fuzz/script_flags.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <pubkey.h>
56
#include <script/interpreter.h>
67
#include <streams.h>
8+
#include <util/memory.h>
79
#include <version.h>
810

911
#include <test/fuzz/fuzz.h>
1012

1113
/** Flags that are not forbidden by an assert */
1214
static bool IsValidFlagCombination(unsigned flags);
1315

16+
void initialize()
17+
{
18+
static const auto verify_handle = MakeUnique<ECCVerifyHandle>();
19+
}
20+
1421
void test_one_input(const std::vector<uint8_t>& buffer)
1522
{
1623
CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);

0 commit comments

Comments
 (0)