You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interesting find.
Basically, whats causing the infinite loop here is a circular reference after adding the same item twice.
I boiled the POC down a bit:
cJSON* root = cJSON_CreateObject();
cJSON* item = cJSON_CreateNumber(42);
cJSON_AddItemToObject(root, "item1", item);
cJSON_AddItemToObject(root, "item2", item); // Circular reference is created here
cJSON_Print(root); // This will enter an infinite loop
Adding the same item to object for more than one time is a broken use of cJSON_AddItemToObject. Simply doing same pointer check in suffix_object will not help much. POC to a similar problem:
To prevent this, we need to check all items in a object/array if the added item already exist when adding a item to a object/array. No doubt this will cause performance problems.
Hi,
when fuzzing cJSON, there is a timeout reported by ASAN. There might is an infinite loop bug in cJSON_DeleteItemFromObjectCaseSensitive.
My environment:
CentOS 5.4
PoC:
poc.tar.gz
The text was updated successfully, but these errors were encountered: