mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 19:22:11 +01:00
g_variant_get_child_value: Add a precondition on length
Ensure callers get a warning if they pass a bad length. Split into a separate commit and changed to order index before n_children by Colin Walters <walters@verbum.org>
This commit is contained in:
parent
56c4e19f35
commit
a62eb4237e
@ -848,6 +848,8 @@ GVariant *
|
||||
g_variant_get_child_value (GVariant *value,
|
||||
gsize index_)
|
||||
{
|
||||
g_return_val_if_fail (index_ < g_variant_n_children (value), NULL);
|
||||
|
||||
if (~g_atomic_int_get (&value->state) & STATE_SERIALISED)
|
||||
{
|
||||
g_variant_lock (value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user