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 <cedric@osg.samsung.com>
This commit is contained in:
parent
6b29613bbe
commit
59c0246eea
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue