elm_entry: add null check logic on elm_entry_text_set API

Summary: If current_text is NULL, a segmentation fault is occured.

Test Plan: N/A

Reviewers: cedric, Hermet, Jaehyun_Cho, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9780
This commit is contained in:
Bowon Ryu 2019-08-30 08:47:19 -04:00 committed by Mike Blumenkrantz
parent 3b3889bdb5
commit bbd213bcfb
1 changed files with 1 additions and 1 deletions

View File

@ -3365,7 +3365,7 @@ _elm_entry_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, const char *e
/* If old and new text are the same do nothing */
current_text = edje_object_part_text_get(sd->entry_edje, "elm.text");
if (current_text == entry || !strcmp(entry, current_text))
if (eina_streq(current_text, entry))
goto done;
ELM_SAFE_FREE(sd->text, eina_stringshare_del);