From 2ad050a5bc91cdec252cfa151dc06289e31bc5c1 Mon Sep 17 00:00:00 2001 From: Shilpa Singh Date: Sun, 4 Oct 2015 15:26:08 +0200 Subject: [PATCH] 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 --- legacy/elementary/src/lib/elc_naviframe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/src/lib/elc_naviframe.c b/legacy/elementary/src/lib/elc_naviframe.c index 4273480..673a694 100644 --- a/legacy/elementary/src/lib/elc_naviframe.c +++ b/legacy/elementary/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* -- 2.7.4