Skip to content

Commit fb16e5c

Browse files
authored
Fix: Type Confusion vulnerability in cJSON_Utils caused by missing type check (#1006)
1 parent b2890c8 commit fb16e5c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cJSON_Utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ static int apply_patch(cJSON *object, const cJSON *patch, const cJSON_bool case_
906906
if ((opcode == MOVE) || (opcode == COPY))
907907
{
908908
cJSON *from = get_object_item(patch, "from", case_sensitive);
909-
if (from == NULL)
909+
if (!cJSON_IsString(from))
910910
{
911911
/* missing "from" for copy/move. */
912912
status = 4;

0 commit comments

Comments
 (0)