eo: null check for vtable allocation

Reviewers: bu5hm4n, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11687
This commit is contained in:
Yeongjong Lee 2020-04-13 19:50:43 +09:00 committed by Jaehyun Cho
parent d43515d9dc
commit aee7d74b15
1 changed files with 4 additions and 0 deletions

View File

@ -906,6 +906,7 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_
klass->class_id = _UNMASK_ID(klass->header.id) - 1;
_vtable_init(&klass->vtable);
if (!klass->vtable.chain) goto err_vtable;
hitmap = alloca(klass->vtable.size);
memset(hitmap, 0, klass->vtable.size);
@ -980,6 +981,9 @@ err_funcs:
err_klass:
_EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id);
return EINA_FALSE;
err_vtable:
ERR("failed to allocate vtable for class '%s'", klass->desc->name);
return EINA_FALSE;
}
static Eo *