mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-08-22 00:19:51 +00:00
Fix: Type Confusion vulnerability in cJSON_Utils caused by missing type check (#1006)
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user