提交 f0c1b896 编写于 作者: M Max Bruckner

handle null pointers: cJSONUtils_GeneratePatches

上级 2d252ae5
......@@ -1228,7 +1228,14 @@ static void create_patches(cJSON * const patches, const unsigned char * const pa
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to)
{
cJSON *patches = cJSON_CreateArray();
cJSON *patches = NULL;
if ((from == NULL) || (to == NULL))
{
return NULL;
}
patches = cJSON_CreateArray();
create_patches(patches, (const unsigned char*)"", from, to, false);
return patches;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册