From f432b17784fe9531ca97c8b8d4031d22526344ea Mon Sep 17 00:00:00 2001 From: youbing54 Date: Sat, 31 Aug 2024 16:36:40 +0800 Subject: [PATCH] =?UTF-8?q?git=20commit=20--m=20'=20IssueNo:=20https://git?= =?UTF-8?q?ee.com/openharmony/third=5Fparty=5FcJSON/issues/IAOD7I=20descri?= =?UTF-8?q?be:=20check=20for=20NULL=20in=20cJSON=5FDetachItemViaPointer=20?= =?UTF-8?q?=E6=8C=91=E5=8D=955.0release=20Feature=20or=20Bugfix:=20Bugfix?= =?UTF-8?q?=20Binary=20Source:Yes=20Signed-off-by:=20youbing54'=20=EF=BC=88cherry=20picked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index e8437b3..63fb043 100644 --- a/cJSON.c +++ b/cJSON.c @@ -2448,7 +2448,7 @@ CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * c CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) { - if ((parent == NULL) || (item == NULL)) + if ((parent == NULL) || (item == NULL) || (item != parent->child && item->prev == NULL)) { return NULL; } -- Gitee