From 5ab68a43249aa8a11e7a0e4d584b88d492a7281b Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Tue, 10 Oct 2017 16:56:44 +0900 Subject: [PATCH] elm_box: 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 Change-Id: I3bb685468cc3bdf44bddff1c51988f8ab37e7627 Signed-off-by: Wonki Kim --- src/lib/elm_box.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c index b7a780d..f052c38 100644 --- a/src/lib/elm_box.c +++ b/src/lib/elm_box.c @@ -552,8 +552,11 @@ _elm_box_unpack_all(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED) ELM_BOX_CHECK(obj); bd = evas_object_smart_data_get(wd->resize_obj); - EINA_LIST_FOREACH (bd->children, l, opt) - _elm_widget_sub_object_redirect_to_top(obj, opt->obj); + if (bd) + { + EINA_LIST_FOREACH (bd->children, l, opt) + _elm_widget_sub_object_redirect_to_top(obj, opt->obj); + } /* EINA_FALSE means to delete objects as well */ evas_object_box_remove_all(wd->resize_obj, EINA_FALSE); -- 2.7.4