elmentary: fix a potential null pointer dereferencing in elm_box

Summary:
if 'evas_object_smart_data_get' return null somehow,
logic that dereference the smart data pointer will cause problems.
This patch prevent a potential bug in advance.

Reviewers: jpeg, woohyun, cedric

Differential Revision: https://phab.enlightenment.org/D5290

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
This commit is contained in:
Wonki Kim 2017-10-13 12:00:59 -07:00 committed by Cedric Bail
parent 295403769b
commit c60b889d35
1 changed files with 5 additions and 2 deletions

View File

@ -475,8 +475,11 @@ _elm_box_unpack_all(Eo *obj, Elm_Box_Data *pd)
/* set this to block _sizing_eval() calls */
pd->delete_me = EINA_TRUE;
bd = evas_object_smart_data_get(wd->resize_obj);
EINA_LIST_FOREACH (bd->children, l, opt)
children = eina_list_append(children, opt->obj);
if (bd)
{
EINA_LIST_FOREACH (bd->children, l, opt)
children = eina_list_append(children, opt->obj);
}
pd->delete_me = EINA_FALSE;
/* EINA_FALSE means do not delete objects */