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
This commit is contained in:
Christopher Michael 2020-03-06 13:04:57 -05:00
parent dceb056a66
commit 7c99e0a444
1 changed files with 2 additions and 2 deletions

View File

@ -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; \