mirror of
https://github.com/DaveGamble/cJSON.git
synced 2024-12-26 21:04:24 +08:00
Merge pull request #519 from Alanscut/issue-516
fix a possible dereference of null pointer
This commit is contained in:
commit
a1e1c208ff
@ -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…
x
Reference in New Issue
Block a user