File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 12
12
#include < net.h>
13
13
#include < primitives/block.h>
14
14
#include < protocol.h>
15
+ #include < pubkey.h>
15
16
#include < streams.h>
16
17
#include < undo.h>
17
18
#include < version.h>
23
24
24
25
#include < test/fuzz/fuzz.h>
25
26
27
+ void initialize ()
28
+ {
29
+ // Fuzzers using pubkey must hold an ECCVerifyHandle.
30
+ static const auto verify_handle = MakeUnique<ECCVerifyHandle>();
31
+ }
32
+
26
33
void test_one_input (const std::vector<uint8_t >& buffer)
27
34
{
28
35
CDataStream ds (buffer, SER_NETWORK, INIT_PROTO_VERSION);
Original file line number Diff line number Diff line change 4
4
5
5
#include < test/fuzz/fuzz.h>
6
6
7
+ #include < cstdint>
7
8
#include < unistd.h>
8
-
9
- #include < pubkey.h>
10
- #include < util/memory.h>
11
-
9
+ #include < vector>
12
10
13
11
static bool read_stdin (std::vector<uint8_t >& data)
14
12
{
@@ -23,10 +21,8 @@ static bool read_stdin(std::vector<uint8_t>& data)
23
21
}
24
22
25
23
// Default initialization: Override using a non-weak initialize().
26
- __attribute__ ((weak))
27
- void initialize()
24
+ __attribute__ ((weak)) void initialize()
28
25
{
29
- const static auto verify_handle = MakeUnique<ECCVerifyHandle>();
30
26
}
31
27
32
28
// This function is used by libFuzzer
@@ -50,7 +46,8 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
50
46
// the main(...) function.
51
47
__attribute__ ((weak))
52
48
#endif
53
- int main (int argc, char **argv)
49
+ int
50
+ main (int argc, char ** argv)
54
51
{
55
52
initialize ();
56
53
#ifdef __AFL_INIT
You can’t perform that action at this time.
0 commit comments