diff options
author | Mike Gorse <mgorse@suse.com> | 2023-05-10 15:26:10 +0000 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2023-05-10 15:26:10 +0000 |
commit | de22b951e23f37c7073d0c86ed9eb034daf3db74 (patch) | |
tree | 56f2d493545c0a1c6c0dae71b9ebd95785b8bbce | |
parent | 77bfacc29cfc56ff868010826e3b714b3980c4c4 (diff) | |
parent | 6c6bf04b5ec1fe88e7db8e7c9047a6fba78bf6ef (diff) | |
download | at-spi2-core-de22b951e23f37c7073d0c86ed9eb034daf3db74.tar.gz |
Merge branch 'fix_114' into 'main'
Don't crash on an empty, but non-null cached children array
Closes #114
See merge request GNOME/at-spi2-core!139
-rw-r--r-- | atspi/atspi-accessible.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index 54f67c8f..1ce6b707 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -490,9 +490,12 @@ atspi_accessible_get_child_at_index (AtspiAccessible *obj, if (!obj->children) return NULL; /* assume disposed */ - child = g_ptr_array_index (obj->children, child_index); - if (child) - return g_object_ref (child); + if (child_index < obj->children->len) + { + child = g_ptr_array_index (obj->children, child_index); + if (child) + return g_object_ref (child); + } } reply = _atspi_dbus_call_partial (obj, atspi_interface_accessible, |