diff options
author | Christopher Michael <devilhorns@comcast.net> | 2020-03-06 13:04:57 -0500 |
---|---|---|
committer | Christopher Michael <devilhorns@comcast.net> | 2020-03-06 13:08:47 -0500 |
commit | 7c99e0a444d81cc545181682f1a4ae00f76d0873 (patch) | |
tree | db44b1b1788c0bb5bdb07fc8301953ca406930a5 | |
parent | dceb056a66c082ecbb80676b6d5d611ff9403b6a (diff) | |
download | efl-7c99e0a444d81cc545181682f1a4ae00f76d0873.tar.gz |
evas_object_intercept: Add check for NULL 'obj' variable inside macros
This patch adds a small check for a valid 'obj' variable inside the
object_intercept macros, which fixes several Coverity reported issues
of NULL pointer dereference.
Fixes CID1420239 through CID1420258
-rw-r--r-- | src/lib/evas/canvas/evas_object_intercept.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c index 325359176c..e5face15d1 100644 --- a/src/lib/evas/canvas/evas_object_intercept.c +++ b/src/lib/evas/canvas/evas_object_intercept.c @@ -264,7 +264,7 @@ _evas_object_intercept_call_evas(Evas_Object_Protected_Data *obj, return; \ MAGIC_CHECK_END(); \ Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); \ - if (!func) return; \ + if ((!obj) || (!func) return; \ evas_object_intercept_init(obj); \ if (!obj->interceptors) return; \ obj->interceptors->Lower_Type.func = func; \ @@ -281,7 +281,7 @@ _evas_object_intercept_call_evas(Evas_Object_Protected_Data *obj, return NULL; \ MAGIC_CHECK_END(); \ Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); \ - if (!func) return NULL; \ + if ((!obj) || (!func)) return NULL; \ if (!obj->interceptors) return NULL; \ obj->interceptors->Lower_Type.func = NULL; \ data = obj->interceptors->Lower_Type.data; \ |