summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/corpus/README1
-rw-r--r--tests/corpus/temp.cc1
-rw-r--r--tests/file_descriptor_parsenew_fuzzer.cc15
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/corpus/README b/tests/corpus/README
new file mode 100644
index 0000000..9bd8f1e
--- /dev/null
+++ b/tests/corpus/README
@@ -0,0 +1 @@
+Corpus folder for fuzzing
diff --git a/tests/corpus/temp.cc b/tests/corpus/temp.cc
new file mode 100644
index 0000000..2bf1160
--- /dev/null
+++ b/tests/corpus/temp.cc
@@ -0,0 +1 @@
+// Hello World
diff --git a/tests/file_descriptor_parsenew_fuzzer.cc b/tests/file_descriptor_parsenew_fuzzer.cc
new file mode 100644
index 0000000..057e62d
--- /dev/null
+++ b/tests/file_descriptor_parsenew_fuzzer.cc
@@ -0,0 +1,15 @@
+#include <cstdint>
+
+#include "google/protobuf/descriptor.upb.h"
+#include "upb/upb.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ upb::Arena arena;
+ google_protobuf_FileDescriptorProto_parse(reinterpret_cast<const char*>(data),
+ size, arena.ptr());
+ return 0;
+}
+
+#ifndef HAVE_FUZZER
+int main() {}
+#endif
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback