glib-aux: assert against NULL arguments for nm_strvarray_add()

This commit is contained in:
Thomas Haller 2023-11-15 16:09:24 +01:00
parent 2d8c4cfe05
commit 7b5e8381f0
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -3007,6 +3007,10 @@ nm_strvarray_add_take(GArray *array, char *str)
nm_assert(array);
nm_assert(sizeof(char *) == g_array_get_element_size(array));
/* The array is used as a NULL terminated strv array. Adding NULL is most
* likely a bug. Assert against it. */
nm_assert(str);
g_array_append_val(array, str);
}