From cd14a72963ebc1a77d387771104730beb5bb63ef Mon Sep 17 00:00:00 2001 From: Ssh1y <909425629@qq.com> Date: Wed, 8 Apr 2026 07:56:02 +0000 Subject: [PATCH] Fix: Type Confusion vulnerability in cJSON_Utils caused by missing type check --- cJSON_Utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 8fa24f8e..8b38eb25 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -906,7 +906,7 @@ static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_ if ((opcode == MOVE) || (opcode == COPY)) { cJSON *from = get_object_item(patch, "from", case_sensitive); - if (from == NULL) + if (!cJSON_IsString(from)) { /* missing "from" for copy/move. */ status = 4;