From: Yeongjong Lee Date: Wed, 25 Sep 2019 10:44:56 +0000 (-0400) Subject: efl_ui_layout: fix null pointer dereferences X-Git-Tag: submit/tizen/20190925.214157~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ecf4b372723ced9aa242d189c171ecb52a44d4ea;p=platform%2Fupstream%2Fefl.git efl_ui_layout: fix null pointer dereferences Summary: If theme doesn't have version data, `version` can be NULL. Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10146 --- diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index be8c5fc..25b5876 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -627,13 +627,16 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) if (!version) ERR("Widget(%p) with type '%s' is not providing a version in its theme!", obj, efl_class_name_get(efl_class_get(obj))); - errno = 0; - sd->version = strtoul(version, NULL, 10); - if (errno) + else { - ERR("Widget(%p) with type '%s' is not providing a valid version in its theme!", obj, - efl_class_name_get(efl_class_get(obj))); - sd->version = 0; + errno = 0; + sd->version = strtoul(version, NULL, 10); + if (errno) + { + ERR("Widget(%p) with type '%s' is not providing a valid version in its theme!", obj, + efl_class_name_get(efl_class_get(obj))); + sd->version = 0; + } } } if (!version)