mirror of
https://github.com/taurusxin/ncmdump.git
synced 2025-07-13 12:52:20 +08:00
Merge pull request #52 from npt-1707/fix_CVE-2023-50471
Some checks failed
CI / build_on_windows_msys2 (push) Has been cancelled
CI / build_on_windows_msvc (push) Has been cancelled
CI / build_on_linux_amd64 (push) Has been cancelled
CI / build_on_macos_amd64 (push) Has been cancelled
CI / build_on_macos_arm64 (push) Has been cancelled
Some checks failed
CI / build_on_windows_msys2 (push) Has been cancelled
CI / build_on_windows_msvc (push) Has been cancelled
CI / build_on_linux_amd64 (push) Has been cancelled
CI / build_on_macos_amd64 (push) Has been cancelled
CI / build_on_macos_arm64 (push) Has been cancelled
Fix potential vulnerable cloned function
This commit is contained in:
commit
80a607a8fb
@ -2142,7 +2142,7 @@ CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newit
|
||||
{
|
||||
cJSON *after_inserted = NULL;
|
||||
|
||||
if (which < 0)
|
||||
if (which < 0 || newitem == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -2154,6 +2154,10 @@ CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newit
|
||||
return;
|
||||
}
|
||||
|
||||
if (after_inserted != array->child && newitem->prev == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
newitem->next = after_inserted;
|
||||
newitem->prev = after_inserted->prev;
|
||||
after_inserted->prev = newitem;
|
||||
|
Loading…
Reference in New Issue
Block a user