summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-02 16:30:11 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-02 21:15:17 -0200
commitfc48161910fc013674f4af9e19ffafd449db2cfd (patch)
treeb57bde8db8e493d1374f014120232a22ff8fde35
parentdfe3a4ad403c5d9219b3f383f8f8147907cff613 (diff)
downloadefl-fc48161910fc013674f4af9e19ffafd449db2cfd.tar.gz
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.
-rw-r--r--src/lib/eo/eo.c3
1 files changed, 3 insertions, 0 deletions
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;