mirror of
https://github.com/openharmony/third_party_cJSON.git
synced 2026-08-26 19:42:18 -04:00
Description: cJSON_SetValuestring入参增加判空防止错误调用导致崩溃
IssueNo:https://gitee.com/openharmony/third_party_cJSON/issues/I9EP9J Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: liubo419 <liubo419@huawei.com>
This commit is contained in:
@@ -406,7 +406,7 @@ CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* return NULL if the object is corrupted */
|
/* return NULL if the object is corrupted */
|
||||||
if (object->valuestring == NULL)
|
if (object->valuestring == NULL || valuestring == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user