stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6f847f1f55820498d2a309524e3af0cc6bedc73f

commit 6f847f1f55820498d2a309524e3af0cc6bedc73f
Author: Stefan Schmidt <ste...@osg.samsung.com>
Date:   Mon Dec 5 16:53:42 2016 +0100

    elm: multibuttomentry: check if value is valid before we access it
    
    The ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN will access 'it' here before we
    check it is NULL. Reverse the order of these checks.
    
    CID: 1365324, 1365323
---
 src/lib/elementary/elc_multibuttonentry.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elc_multibuttonentry.c 
b/src/lib/elementary/elc_multibuttonentry.c
index fafe7b3..bdd5f6b 100644
--- a/src/lib/elementary/elc_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -551,9 +551,10 @@ _on_item_focused(void *data,
                  void *event_info EINA_UNUSED)
 {
    Elm_Multibuttonentry_Item_Data *it = data;
+   if (!it) return;
+
    ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
 
-   if (!it) return;
    sd->selected_it = it;
 }
 
@@ -563,9 +564,10 @@ _on_item_unfocused(void *data,
                    void *event_info EINA_UNUSED)
 {
    Elm_Multibuttonentry_Item_Data *it = data;
+   if (!it) return;
+
    ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(WIDGET(it), sd);
 
-   if (!it) return;
    sd->selected_it = NULL;
    elm_layout_signal_emit(VIEW(it), "elm,state,unfocused", "elm");
 }

-- 


Reply via email to