jaehyun pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=d64c7ca19650b913ce28126e502cccef6300c9be

commit d64c7ca19650b913ce28126e502cccef6300c9be
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Mon Mar 7 16:56:31 2016 +0900

    live_edit: Prevent memory overflow case.
    
    Emum value Ctrl_Pt_Cnt is only used to set array size.
    Therefore, Ctrl_Pt_Cnt should not be used as an index value.
    
    @fix
---
 src/bin/live_edit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/bin/live_edit.c b/src/bin/live_edit.c
index fe4eda6..3ef94a5 100644
--- a/src/bin/live_edit.c
+++ b/src/bin/live_edit.c
@@ -563,6 +563,7 @@ cp_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, 
void *event_info)
 
    //Dispatch to actual mouse move call
    Ctrl_Pt cp = (Ctrl_Pt) evas_object_data_get(obj, "index");
+   if (cp == Ctrl_Pt_Cnt) return; //not to use Ctrl_Pt_Cnt as index.
 
    //Show Control Point
    live_data *ld = data;
@@ -594,8 +595,6 @@ cp_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, 
void *event_info)
         case Ctrl_Pt_Right:
           cp_right_mouse_move_cb(data, e, obj, event_info);
           break;
-        case Ctrl_Pt_Cnt: //for avoiding compiler warning.
-          break;
      }
    live_edit_update_internal(ld);
 }

-- 


Reply via email to