Skip to content

Commit

Permalink
strengthen the protection of strlen
Browse files Browse the repository at this point in the history
when using flash's mmap method to access json strings, can strengthen the protection of strlen when flash data is all 0xff
  • Loading branch information
zjykymt committed Jan 2, 2025
1 parent 12c4bf1 commit 5c21105
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return
{
size_t buffer_length;

if (NULL == value)
if (NULL == value || (*value != '[' && *value != '{'))
{
return NULL;
}
Expand Down

0 comments on commit 5c21105

Please sign in to comment.