diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-04-27 13:45:54 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-04-27 13:45:54 +0200 |
commit | 51d779256c74cc541da306db5629ed510df5a944 (patch) | |
tree | ec23431d0b9b3dac2a2a8ac8f7201e9da9c58632 /deps/cpp-httplib/test/fuzzing/standalone_fuzz_target_runner.cpp | |
parent | da307fb4c6b5028d50c09dec7265ce8715e035d5 (diff) |
Switched from slow blocking cpp-httplib to libevent2.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'deps/cpp-httplib/test/fuzzing/standalone_fuzz_target_runner.cpp')
-rw-r--r-- | deps/cpp-httplib/test/fuzzing/standalone_fuzz_target_runner.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/deps/cpp-httplib/test/fuzzing/standalone_fuzz_target_runner.cpp b/deps/cpp-httplib/test/fuzzing/standalone_fuzz_target_runner.cpp deleted file mode 100644 index 8e34792..0000000 --- a/deps/cpp-httplib/test/fuzzing/standalone_fuzz_target_runner.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 Google Inc. All Rights Reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); - -// This runner does not do any fuzzing, but allows us to run the fuzz target -// on the test corpus or on a single file, -// e.g. the one that comes from a bug report. - -#include <cassert> -#include <iostream> -#include <fstream> -#include <vector> - -// Forward declare the "fuzz target" interface. -// We deliberately keep this inteface simple and header-free. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); - -// It reads all files passed as parameters and feeds their contents -// one by one into the fuzz target (LLVMFuzzerTestOneInput). -int main(int argc, char **argv) { - for (int i = 1; i < argc; i++) { - std::ifstream in(argv[i]); - in.seekg(0, in.end); - size_t length = in.tellg(); - in.seekg (0, in.beg); - std::cout << "Reading " << length << " bytes from " << argv[i] << std::endl; - // Allocate exactly length bytes so that we reliably catch buffer overflows. - std::vector<char> bytes(length); - in.read(bytes.data(), bytes.size()); - LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()), - bytes.size()); - std::cout << "Execution successful" << std::endl; - } - std::cout << "Execution finished" << std::endl; - return 0; -}
\ No newline at end of file |