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
This is definitely a bug and most likely also a security issue, since an attacker could make realloc fail at exactly the right moment while also providing a big JSON (big offset), thereby potentially producing a pointer to an arbitrary memory address that will be written to by cJSON later on.
I will fix it immediately and create a new bugfix release.
https://github.com/DaveGamble/cJSON/blob/master/cJSON.c#L379
The calls to reallocate is assumed to return a valid pointer. If it fails, NULL should be returned instead of newbuffer + p->offset.
The text was updated successfully, but these errors were encountered: