2018-02-05 19:24:51 -06:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#include <json.h>
|
|
|
|
|
|
2020-03-28 10:25:00 +08:00
|
|
|
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);
|
2022-04-13 15:42:46 +02:00
|
|
|
|
2023-10-19 16:33:01 +09:00
|
|
|
if (json_object_is_type(obj, json_type_object)) {
|
|
|
|
|
json_object_object_foreach(obj, key, val) {
|
|
|
|
|
(void)json_object_get_type(val);
|
|
|
|
|
(void)json_object_get_string(val);
|
|
|
|
|
}
|
2022-04-13 15:42:46 +02:00
|
|
|
}
|
2023-09-05 13:58:51 -07:00
|
|
|
(void)json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED);
|
2022-04-13 15:42:46 +02:00
|
|
|
|
2020-03-28 10:25:00 +08:00
|
|
|
json_object_put(obj);
|
|
|
|
|
json_tokener_free(tok);
|
|
|
|
|
return 0;
|
2018-02-05 19:24:51 -06:00
|
|
|
}
|