You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

tokener_parse_ex_fuzzer.cc 555 B

1234567891011121314151617181920
  1. #include <stdint.h>
  2. #include <json.h>
  3. extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
  4. {
  5. const char *data1 = reinterpret_cast<const char *>(data);
  6. json_tokener *tok = json_tokener_new();
  7. json_object *obj = json_tokener_parse_ex(tok, data1, size);
  8. json_object_object_foreach(obj, key, val) {
  9. (void)json_object_get_type(val);
  10. (void)json_object_get_string(val);
  11. }
  12. (void)json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED);
  13. json_object_put(obj);
  14. json_tokener_free(tok);
  15. return 0;
  16. }