Fix: Type Confusion vulnerability in cJSON_Utils caused by missing type check (#1006)

This commit is contained in:
Ssh1y Ripple
2026-04-09 09:59:11 +08:00
committed by GitHub
parent b2890c8d76
commit fb16e5cf35
+1 -1
View File
@@ -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;