Add simple fuzz target for upb

pull/13171/head
Google AutoFuzz Team 6 years ago committed by GitHub
parent 312c6b421a
commit c4a8498103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      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;
}
Loading…
Cancel
Save