diff --git a/dependency/cJSON/CVE-2023-50471andCVE-2023-50472.patch b/dependency/cJSON/CVE-2023-50471andCVE-2023-50472.patch index a735f577ce1f37578acc310cd69d981472ce60ad..774e3b0f4ab9cb4e5bdd9e5c2ab5d0b319b1a5bc 100644 --- a/dependency/cJSON/CVE-2023-50471andCVE-2023-50472.patch +++ b/dependency/cJSON/CVE-2023-50471andCVE-2023-50472.patch @@ -1,6 +1,6 @@ diff -Naur a/cJSON.c b/cJSON.c ---- a/cJSON.c 2023-12-18 17:23:27.699147290 +0800 -+++ b/cJSON.c 2023-12-18 17:35:00.991106214 +0800 +--- a/cJSON.c 2024-02-05 19:23:06.722566273 +0800 ++++ b/cJSON.c 2024-02-05 19:22:33.685276776 +0800 @@ -401,7 +401,12 @@ { char *copy = NULL; @@ -28,17 +28,17 @@ diff -Naur a/cJSON.c b/cJSON.c return add_item_to_array(array, newitem); } -+ if (after_inserted != array->child && newitem->prev == NULL) { ++ if (after_inserted != array->child && after_inserted->prev == NULL) { + /* return false if after_inserted is a corrupted array item */ + return false; + } -+ ++ newitem->next = after_inserted; newitem->prev = after_inserted->prev; after_inserted->prev = newitem; diff -Naur a/tests/misc_tests.c b/tests/misc_tests.c ---- a/tests/misc_tests.c 2023-12-18 17:23:27.699147290 +0800 -+++ b/tests/misc_tests.c 2023-12-18 17:38:04.161210785 +0800 +--- a/tests/misc_tests.c 2024-02-05 19:23:06.726566308 +0800 ++++ b/tests/misc_tests.c 2024-02-05 19:22:33.689276811 +0800 @@ -353,6 +353,19 @@ { char buffer[10];