diff options
Diffstat (limited to 'test/core/util/one_corpus_entry_fuzzer.cc')
-rw-r--r-- | test/core/util/one_corpus_entry_fuzzer.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/core/util/one_corpus_entry_fuzzer.cc b/test/core/util/one_corpus_entry_fuzzer.cc index c0b67da1e2..c745eb5dc6 100644 --- a/test/core/util/one_corpus_entry_fuzzer.cc +++ b/test/core/util/one_corpus_entry_fuzzer.cc @@ -18,7 +18,10 @@ #include <stdbool.h> +#include <grpc/grpc.h> + #include <grpc/support/log.h> +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/load_file.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); @@ -30,10 +33,15 @@ int main(int argc, char** argv) { grpc_slice buffer; squelch = false; leak_check = false; + /* TODO(yashkt) Calling grpc_init breaks tests. Fix the tests and replace + * grpc_core::ExecCtx::GlobalInit with grpc_init and GlobalShutdown with + * grpc_shutdown */ GPR_ASSERT( GRPC_LOG_IF_ERROR("load_file", grpc_load_file(argv[1], 0, &buffer))); LLVMFuzzerTestOneInput(GRPC_SLICE_START_PTR(buffer), GRPC_SLICE_LENGTH(buffer)); + grpc_core::ExecCtx::GlobalInit(); grpc_slice_unref(buffer); + grpc_core::ExecCtx::GlobalShutdown(); return 0; } |