From 0d1a9621f623b3ab153d7678724c09e71c508d2e Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 19 Aug 2019 17:18:07 +0900 Subject: [PATCH] edc_editor: ++safety don't access null pointer. --- src/lib/edc_editor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c index d5914fc..db8f9c4 100644 --- a/src/lib/edc_editor.c +++ b/src/lib/edc_editor.c @@ -231,16 +231,15 @@ syntax_color_apply(edit_data *ed, Eina_Bool partial) { Evas_Object *tb = elm_entry_textblock_get(ed->en_edit); char *text = (char *) evas_object_textblock_text_markup_get(tb); + if (!text) return EINA_FALSE; + int text_len = strlen(text); //FIXME: We encountered a syntax coloring issue that won't be applied //at the opening an edc script. The situation condition is below, //and we try syntax coloring again in that case. Work around logic, //but it works. - if (text && (text_len == 0)) - { - return EINA_FALSE; - } + if (text_len == 0) return EINA_FALSE; int from_line = 1; int to_line = -1;