mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-09-04 22:49:54 +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))
|
if ((opcode == MOVE) || (opcode == COPY))
|
||||||
{
|
{
|
||||||
cJSON *from = get_object_item(patch, "from", case_sensitive);
|
cJSON *from = get_object_item(patch, "from", case_sensitive);
|
||||||
if (from == NULL)
|
if (!cJSON_IsString(from))
|
||||||
{
|
{
|
||||||
/* missing "from" for copy/move. */
|
/* missing "from" for copy/move. */
|
||||||
status = 4;
|
status = 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user