From c4a8498103cecc9a29664f0aa899d22e1a1d5ac6 Mon Sep 17 00:00:00 2001 From: Google AutoFuzz Team Date: Thu, 13 Jun 2019 11:43:22 -0400 Subject: Add simple fuzz target for upb --- tests/file_descriptor_parsenew_fuzzer.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/file_descriptor_parsenew_fuzzer.cc (limited to 'tests/file_descriptor_parsenew_fuzzer.cc') diff --git a/tests/file_descriptor_parsenew_fuzzer.cc b/tests/file_descriptor_parsenew_fuzzer.cc new file mode 100644 index 0000000..4166469 --- /dev/null +++ b/tests/file_descriptor_parsenew_fuzzer.cc @@ -0,0 +1,16 @@ +#include +#include +#include + +#include "google/protobuf/descriptor.upb.h" +#include "upb/def.h" +#include "upb/msg.h" +#include "upb/upb.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + upb_strview strview = + upb_strview_make(reinterpret_cast(data), size); + upb::Arena arena; + google_protobuf_FileDescriptorProto_parsenew(strview, arena.ptr()); + return 0; +} -- cgit v1.2.3