summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorYeongjong Lee <cleanlyj@naver.com>2018-08-16 13:01:26 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-16 13:01:39 -0400
commit8bb11a172bfaac94b317f90004879356672e1571 (patch)
treee34b83327a81eaa63ed4ab9539ee43a2fa4fcfdc /src/lib/edje
parent633d16aae7d288e615cdf4586043a9d2cc409f66 (diff)
evas: check evas class instead of using evas_find
Summary: A object that is not evas class shouldn't use evas_find. it may occurs segfault. ref c2e8b492b18bdecc2300ad051ba1406e40ad068f Test Plan: Evas *evas = evas_new(); evas_free(evas); evas_object_line_add(evas); Check weather there is segfault. Reviewers: Hermet, raster, zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6816
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_edit.c3
-rw-r--r--src/lib/edje/edje_smart.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 2527598c69..e2bbc8498f 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -13,6 +13,8 @@
13 13
14#include "edje_private.h" 14#include "edje_private.h"
15 15
16#include "canvas/evas_canvas.eo.h"
17
16#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT 18#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT
17#include "Edje_Edit.h" 19#include "Edje_Edit.h"
18 20
@@ -289,6 +291,7 @@ _edje_edit_efl_file_mmap_set(Eo *obj, Edje_Edit *eed, const Eina_File *mmap, con
289EAPI Evas_Object * 291EAPI Evas_Object *
290edje_edit_object_add(Evas *evas) 292edje_edit_object_add(Evas *evas)
291{ 293{
294 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
292 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 295 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
293} 296}
294 297
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 29d042c40d..9e405ceb56 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -4,6 +4,8 @@
4 4
5#include "edje_private.h" 5#include "edje_private.h"
6 6
7#include "canvas/evas_canvas.eo.h"
8
7#ifdef MY_CLASS 9#ifdef MY_CLASS
8# undef MY_CLASS 10# undef MY_CLASS
9#endif 11#endif
@@ -20,7 +22,7 @@ Eina_Inlist *_edje_edjes = NULL;
20EAPI Evas_Object * 22EAPI Evas_Object *
21edje_object_add(Evas *evas) 23edje_object_add(Evas *evas)
22{ 24{
23 EINA_SAFETY_ON_NULL_RETURN_VAL(evas, NULL); 25 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(evas, EVAS_CANVAS_CLASS), NULL);
24 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added)); 26 return efl_add(MY_CLASS, evas_find(evas), efl_canvas_object_legacy_ctor(efl_added));
25} 27}
26 28