diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-09-21 11:08:46 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-09-21 20:43:56 +0200 |
commit | 18e9a224beed7407b46c82f6d0bf282aa4376bf0 (patch) | |
tree | 401523b11e26d8f11b360d23311393cd1d63acf8 | |
parent | 64be497e42e2e86f100eb177b2b80200fc8e1da0 (diff) | |
download | efl-18e9a224beed7407b46c82f6d0bf282aa4376bf0.tar.gz |
efl_ui_collection: protect against invalid access
i am not sure why this should ever happen. However, a error here is
better than a access out of the bounds of the array.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10066
-rw-r--r-- | src/lib/elementary/efl_ui_collection.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index 718f5b120e..82e21d3dc1 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -1152,8 +1152,9 @@ _efl_ui_collection_efl_ui_single_selectable_fallback_selection_get(const Eo *obj #define ITEM_IS_OUTSIDE_VISIBLE(id) id < collection_pd->start_id || id > collection_pd->end_id static inline void -_assert_item_available(Eo *item, int new_id, Efl_Ui_Collection_Data *pd) +_assert_item_available(Eo *item, unsigned int new_id, Efl_Ui_Collection_Data *pd) { + EINA_SAFETY_ON_FALSE_RETURN(new_id < eina_list_count(pd->items)); efl_gfx_entity_visible_set(item, EINA_TRUE); efl_gfx_entity_geometry_set(item, efl_ui_position_manager_entity_position_single_item(pd->pos_man, new_id)); } |