mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
garray: Add some additional length assertions
This should shut Coverity up. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Coverity CID: #1502194
This commit is contained in:
@@ -1371,6 +1371,7 @@ ptr_array_new_from_array (gpointer *data,
|
||||
GPtrArray *array;
|
||||
GRealPtrArray *rarray;
|
||||
|
||||
g_assert (data != NULL || len == 0);
|
||||
g_assert (len <= G_MAXUINT);
|
||||
|
||||
array = ptr_array_new (len, element_free_func, null_terminated);
|
||||
@@ -1478,6 +1479,7 @@ g_ptr_array_new_from_null_terminated_array (gpointer *data,
|
||||
len += 1;
|
||||
}
|
||||
|
||||
g_assert (data != NULL || len == 0);
|
||||
g_return_val_if_fail (len <= G_MAXUINT, NULL);
|
||||
|
||||
return ptr_array_new_from_array (
|
||||
|
Reference in New Issue
Block a user