discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ddeae9642128a281cf8f531b8403669355e36a99
commit ddeae9642128a281cf8f531b8403669355e36a99 Author: Bowon Ryu <[email protected]> Date: Mon Jun 25 06:55:57 2018 -0400 elm_slider: add null check to avoid seg fault. Summary: a segmentation fault occurs once the argument is not valid. Test Plan: N/A Reviewers: eagleeye, devilhorns, zmike Reviewed By: eagleeye, zmike Subscribers: #committers, cedric, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6362 --- src/lib/elementary/elm_slider.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index b0d53292d2..7b36da532e 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -1236,7 +1236,7 @@ EAPI void elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { Efl_Ui_Dir dir; - EFL_UI_SLIDER_DATA_GET(obj, sd2); + EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2); dir = _direction_get(horizontal, _is_inverted(sd2->dir)); @@ -1246,6 +1246,8 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EAPI Eina_Bool elm_slider_horizontal_get(const Evas_Object *obj) { + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); + Efl_Ui_Dir dir; dir = efl_ui_direction_get(obj); @@ -1280,7 +1282,7 @@ EAPI void elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) { Efl_Ui_Dir dir; - EFL_UI_SLIDER_DATA_GET(obj, sd2); + EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2); dir = _direction_get(_is_horizontal(sd2->dir), inverted); --
