mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
tests: Skip unnecessary fuzzer initialisation. Hold ECCVerifyHandle only when needed.
This commit is contained in:
parent
c5ac7af779
commit
db4bd32cc3
2 changed files with 12 additions and 8 deletions
|
|
@ -4,11 +4,9 @@
|
|||
|
||||
#include <test/fuzz/fuzz.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <pubkey.h>
|
||||
#include <util/memory.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
static bool read_stdin(std::vector<uint8_t>& data)
|
||||
{
|
||||
|
|
@ -23,10 +21,8 @@ static bool read_stdin(std::vector<uint8_t>& data)
|
|||
}
|
||||
|
||||
// Default initialization: Override using a non-weak initialize().
|
||||
__attribute__((weak))
|
||||
void initialize()
|
||||
__attribute__((weak)) void initialize()
|
||||
{
|
||||
const static auto verify_handle = MakeUnique<ECCVerifyHandle>();
|
||||
}
|
||||
|
||||
// This function is used by libFuzzer
|
||||
|
|
@ -50,7 +46,8 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
|
|||
// the main(...) function.
|
||||
__attribute__((weak))
|
||||
#endif
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
initialize();
|
||||
#ifdef __AFL_INIT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue