Browse Source

fix a possible dereference of null pointer

pull/519/head
Alanscut 4 years ago
parent
commit
9bf4960cd5
  1. 4
      cJSON_Utils.c

4
cJSON_Utils.c

@ -1406,6 +1406,10 @@ static cJSON *generate_merge_patch(cJSON * const from, cJSON * const to, const c
from_child = from->child; from_child = from->child;
to_child = to->child; to_child = to->child;
patch = cJSON_CreateObject(); patch = cJSON_CreateObject();
if (patch == NULL)
{
return NULL;
}
while (from_child || to_child) while (from_child || to_child)
{ {
int diff; int diff;

Loading…
Cancel
Save