From a3bb0d8855fc97d5cbabb831684467690502f233 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Wed, 3 Apr 2019 13:35:01 +0900 Subject: [PATCH] elm_entry: prevent from accessing null pointer Summary: change ELM_ENTRY_DATA_GET to ELM_ENTRY_DATA_GET_OR_RETURN_VAL Test Plan: elm_entry_file_set(NULL, ~~~); Reviewers: YOhoho, Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8544 Change-Id: I728a485db981b8c54a03476d1daee1e0c8c246bb --- src/lib/elementary/elm_entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index afc61e0..5fc7b0a 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -6653,8 +6653,8 @@ _elm_entry_file_text_format_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Tex EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format) { - Eina_Bool ret; - ELM_ENTRY_DATA_GET(obj, sd); + Eina_Bool ret = EINA_FALSE; + ELM_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, ret); ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); if (sd->auto_save) _save_do(obj); elm_obj_entry_file_text_format_set(obj, format); -- 2.7.4