cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=59c0246eeafa0e1bbce4a61eea3687d77b105ce6

commit 59c0246eeafa0e1bbce4a61eea3687d77b105ce6
Author: Wonki Kim <wonki_....@samsung.com>
Date:   Tue Mar 6 17:32:24 2018 -0800

    evas: add null check logic on evas_object_smart_attach
    
    Summary:
    this commit add null check logic on evas_object_smart_attach
    because a segmentation fault occurs once the argument is not valid (eg. 
null).
    
    Test Plan:
            1. invoke evas_object_smart_add(obj, NULL)
            2. see the application crashes
    
    Reviewers: woohyun, cedric
    
    Differential Revision: https://phab.enlightenment.org/D5817
    
    Signed-off-by: Cedric Bail <ced...@osg.samsung.com>
---
 src/lib/evas/canvas/evas_object_smart.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_smart.c 
b/src/lib/evas/canvas/evas_object_smart.c
index b0eed523cd..fc81e936d7 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -918,6 +918,10 @@ evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart 
*s)
    Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
    unsigned int i;
 
+   MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
+   return;
+   MAGIC_CHECK_END();
+
    obj->smart.smart = s;
    obj->type = s->smart_class->name;
    evas_object_smart_use(s);

-- 


Reply via email to