From fc48161910fc013674f4af9e19ffafd449db2cfd Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 2 Dec 2016 16:30:11 -0200 Subject: [PATCH] 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. --- src/lib/eo/eo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index ce28395d3f..71ef7155ca 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -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;