mirror of
https://github.com/json-c/json-c.git
synced 2026-04-06 05:49:07 +08:00
Fix various potential null ptr deref and int32 overflows
This fix errors that can happen when ingesting very large JSON files when hitting the maximum heap size of the process.
This commit is contained in:
@@ -934,6 +934,11 @@ struct json_object* json_object_new_array(void)
|
||||
jso->_delete = &json_object_array_delete;
|
||||
jso->_to_json_string = &json_object_array_to_json_string;
|
||||
jso->o.c_array = array_list_new(&json_object_array_entry_free);
|
||||
if(jso->o.c_array == NULL)
|
||||
{
|
||||
free(jso);
|
||||
return NULL;
|
||||
}
|
||||
return jso;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user