From: Jihoon Kim <jihoon48.kim@samsung.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 29 Jul 2011 11:48:56 +0000 (11:48 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 29 Jul 2011 11:48:56 +0000 (11:48 +0000)
Subject: [E-devel] [PATCH] check NULL parameter in edje entry

This simple patch is for checking NULL parameter in the callback
functions
related to input method framework.
I think it is necessary for safety.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@61890 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_entry.c

index fcd7185..d7fa2e4 100644 (file)
@@ -2694,7 +2694,7 @@ _edje_entry_imf_event_commit_cb(void *data, int type __UNUSED__, void *event)
    Evas_Textblock_Cursor *tc;
    Eina_Bool cursor_move = EINA_FALSE;
 
-   if (!rp) return ECORE_CALLBACK_PASS_ON;
+   if ((!rp) || (!ev) || (!ev->str)) return ECORE_CALLBACK_PASS_ON;
 
    en = rp->entry_data;
    if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
@@ -2779,7 +2779,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, int type __UNUSED__, void *
    int i;
    Eina_Bool preedit_end_state = EINA_FALSE;
 
-   if (!rp) return ECORE_CALLBACK_PASS_ON;
+   if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON;
 
    en = rp->entry_data;
    if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
@@ -2873,7 +2873,7 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, int type __UNUSED__, voi
    Evas_Textblock_Cursor *del_start, *del_end;
    int cursor_pos;
 
-   if (!rp) return ECORE_CALLBACK_PASS_ON;
+   if ((!rp) || (!ev)) return ECORE_CALLBACK_PASS_ON;
    en = rp->entry_data;
    if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
        (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))