mirror of
https://github.com/json-c/json-c.git
synced 2026-04-05 13:29:06 +08:00
pull in fuzzers, add CI scripts later
Conflicts: ChangeLog
This commit is contained in:
committed by
Eric Haszlakiewicz
parent
d222b13758
commit
33e166a685
13
fuzz/tokener_parse_ex_fuzzer.cc
Normal file
13
fuzz/tokener_parse_ex_fuzzer.cc
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <json.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
const char *data1 = reinterpret_cast<const char *>(data);
|
||||
json_tokener *tok = json_tokener_new();
|
||||
json_object *obj = json_tokener_parse_ex(tok, data1, size);
|
||||
|
||||
json_object_put(obj);
|
||||
json_tokener_free(tok);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user