mirror of
https://github.com/json-c/json-c.git
synced 2026-03-26 08:29:06 +08:00
Merge pull request #219 from rouault/low_heap_robustness_fixes
Fix various potential null ptr deref and int32 overflows
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