cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=1634653bb3b56a6344660d6062ee8247a766f434

commit 1634653bb3b56a6344660d6062ee8247a766f434
Author: Shilpa Singh <shilpa.si...@samsung.com>
Date:   Sun Oct 4 15:26:08 2015 +0200

    elc_naviframe: fix crash in strcmp, if text_set is NULL issue
    
    Summary:
    Issue: If text set is NULL to naviframe, crash happens in strcmp
    Soln: Check for text if NULL,  before passing to strcmp
    
    @fix
    
    Test Plan:
    //Pass the text as NULL
    elm_object_part_text_set(nf, "title", NULL);
    
    Reviewers: Hermet, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D3052
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/elc_naviframe.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 4273480..673a694 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -1018,12 +1018,16 @@ EOLIAN static Eina_Bool
 _elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd 
EINA_UNUSED, const char *part, const char *label)
 {
    Elm_Object_Item *it;
+   const char *text = NULL;
 
    it = elm_naviframe_top_item_get(obj);
    if (!it) return EINA_FALSE;
 
    elm_object_item_part_text_set(it, part, label);
-   return !strcmp(elm_object_item_part_text_get(it, part), label);
+   text = elm_object_item_part_text_get(it, part);
+   if ((text) && !strcmp(text, label))
+     return EINA_TRUE;
+   return EINA_FALSE;
 }
 
 EOLIAN static const char*

-- 


Reply via email to