Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f28a468

Browse files
vwvwAlanscut
authored andcommitted
Check for NULL in cJSON_DetachItemViaPointer
1 parent 424ce4c commit f28a468

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎cJSON.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * c
22042204

22052205
CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item)
22062206
{
2207-
if ((parent == NULL) || (item == NULL))
2207+
if ((parent == NULL) || (parent->child==NULL) || (item==NULL) || (item->prev == NULL))
22082208
{
22092209
return NULL;
22102210
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /