jansson/ossfuzz/json_load_fuzzer.cc

12 lines
269 B
C++
Raw Normal View History

2019-06-28 20:22:51 +08:00
#include <stdint.h>
#include "jansson.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
json_error_t error;
auto jobj = json_loadb(reinterpret_cast<const char *>(data), size, 0, &error);
if (jobj)
json_decref(jobj);
return 0;
}