summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpa Singh <shilpa.singh@samsung.com>2015-10-04 15:26:08 +0200
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commitf28d9e27a689b48bfe727d78a7daa41a8682ac5e (patch)
tree3befa10f37c755266c1f03e6fcd088efb8c8376c
parentfc4345e8ee4dcaaaff428a23d80524816e2cd215 (diff)
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 <cedric@osg.samsung.com>
-rw-r--r--src/lib/elc_naviframe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 4273480d6..673a69479 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -1018,12 +1018,16 @@ EOLIAN static Eina_Bool
1018_elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, const char *label) 1018_elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, const char *label)
1019{ 1019{
1020 Elm_Object_Item *it; 1020 Elm_Object_Item *it;
1021 const char *text = NULL;
1021 1022
1022 it = elm_naviframe_top_item_get(obj); 1023 it = elm_naviframe_top_item_get(obj);
1023 if (!it) return EINA_FALSE; 1024 if (!it) return EINA_FALSE;
1024 1025
1025 elm_object_item_part_text_set(it, part, label); 1026 elm_object_item_part_text_set(it, part, label);
1026 return !strcmp(elm_object_item_part_text_get(it, part), label); 1027 text = elm_object_item_part_text_get(it, part);
1028 if ((text) && !strcmp(text, label))
1029 return EINA_TRUE;
1030 return EINA_FALSE;
1027} 1031}
1028 1032
1029EOLIAN static const char* 1033EOLIAN static const char*