eo: check for empty vtable and failed extensions.

if for some reason we fail to validate a class, then we should skip
that extension. This may result in an empty vtable, then check for
that and avoid a crash.

This is very unlike to happen in practice, but I've forced some
validation errors and could get to that.
This commit is contained in:
Gustavo Sverzut Barbieri 2016-12-02 16:30:11 -02:00
parent dfe3a4ad40
commit fc48161910
1 changed files with 3 additions and 0 deletions

View File

@ -1249,6 +1249,8 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
while (extn_id)
{
extn = _eo_class_pointer_get((Efl_Class *)extn_id, __FUNCTION__, __FILE__, __LINE__);
if (!extn) /* did not validate */
continue;
switch (extn->desc->type)
{
case EFL_CLASS_TYPE_REGULAR_NO_INSTANT:
@ -1412,6 +1414,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
}
/* Mark which classes we implement */
if (klass->vtable.size)
{
const _Efl_Class **extn_itr;