diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-06-13 16:02:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 16:02:07 -0700 |
commit | 6ce5e722f16e74deff65db87eb1244f4396b2832 (patch) | |
tree | 7de4c5ba5ed4b47f0c85d45d7b56d2c38db56f60 /tests | |
parent | 312c6b421a3c749e4f7c0e2193d4775cb997cff7 (diff) | |
parent | 76baf906c9789e02614014edb128e00713fefc45 (diff) |
Merge pull request #186 from Google-Autofuzz/master
Add Fuzz target and modified BUILD
Diffstat (limited to 'tests')
-rw-r--r-- | tests/file_descriptor_parsenew_fuzzer.cc | 16 |
1 files changed, 16 insertions, 0 deletions
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 <cstddef> +#include <cstdint> +#include <cstdlib> + +#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<const char*>(data), size); + upb::Arena arena; + google_protobuf_FileDescriptorProto_parsenew(strview, arena.ptr()); + return 0; +} |