diff options
author | Julien Voisin <jvoisin@users.noreply.github.com> | 2022-04-13 15:42:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-13 15:42:46 +0200 |
commit | 558d48a6f30a97939d0fd69e607481eff3cec33f (patch) | |
tree | 1f3966f51c9cb96383ef8ce281071a68fde7af93 | |
parent | 46b58ad9e7284b96b4b70b27f6cc253b1c37811f (diff) | |
download | json-c-558d48a6f30a97939d0fd69e607481eff3cec33f.tar.gz |
Improve a bit the coverage of the fuzzer
-rw-r--r-- | fuzz/tokener_parse_ex_fuzzer.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fuzz/tokener_parse_ex_fuzzer.cc b/fuzz/tokener_parse_ex_fuzzer.cc index 862149b..f058e0f 100644 --- a/fuzz/tokener_parse_ex_fuzzer.cc +++ b/fuzz/tokener_parse_ex_fuzzer.cc @@ -7,7 +7,13 @@ 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_object_foreach(jobj, key, val) { + (void)json_object_get_type(val); + (void)json_object_get_string(val); + } + (void)json_object_to_json_string(obj, JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED); + json_object_put(obj); json_tokener_free(tok); return 0; |