diff --git a/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp b/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp index 7996ae3d266fa81d28769600f2e7ba13bd8c01c4..1732fa117d1440d3ed00a23b540ceae723950fd6 100644 --- a/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp +++ b/test/fuzztest/pttypesexceptiondetailscreate_fuzzer/pttypesexceptiondetailscreate_fuzzer.cpp @@ -30,7 +30,10 @@ namespace OHOS { if (size <= 0 || data == NULL) { return; } - cJSON* cjson = cJSON_ParseWithLength((const char*)data, size); + // if data: "{\"\":1," + // cJSON_ParseWithLength will heap-buffer-overflow + // https://github.com/DaveGamble/cJSON/issues/804 + cJSON* cjson = NULL; if (cjson != NULL) { PtJson pjson(cjson); auto details = ExceptionDetails::Create(pjson);