From fb16e5cf358798aabb049655975cde8427101056 Mon Sep 17 00:00:00 2001 From: Ssh1y Ripple <62094604+Ssh1y@users.noreply.github.com> Date: Thu, 9 Apr 2026 09:59:11 +0800 Subject: [PATCH] Fix: Type Confusion vulnerability in cJSON_Utils caused by missing type check (#1006) --- cJSON_Utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 8fa24f8..8b38eb2 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;