From 27095e859a26b0c938d894463a180e6a1f6e0568 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Thu, 14 Mar 2019 07:22:44 -0400 Subject: [PATCH] efl_ui_grid: Fix dereferencing null pointer Summary: Coverity reports EFL_UI_GRID_ITEM_DATA_GET can return NULL (checked 273 out of 281 times). As such, we should verify that 'id' is not NULL here before trying to dereference it. Fixes Coverity CID1397000 @fix Depends on D8318 Reviewers: raster, cedric, q66, zmike, bu5hm4n, stefan Reviewed By: cedric Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8319 --- src/lib/elementary/efl_ui_grid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c index 58cacdd6f3..9c8b597e0e 100644 --- a/src/lib/elementary/efl_ui_grid.c +++ b/src/lib/elementary/efl_ui_grid.c @@ -167,6 +167,7 @@ _reposition(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Eina_Position2D pan) EINA_LIST_FOREACH(pd->items, l, item) { EFL_UI_GRID_ITEM_DATA_GET(item, id); + if (!id) continue; ipos.x = id->geo.x - pan.x; ipos.y = id->geo.y - pan.y;