barbieri pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fc48161910fc013674f4af9e19ffafd449db2cfd

commit fc48161910fc013674f4af9e19ffafd449db2cfd
Author: Gustavo Sverzut Barbieri <barbi...@profusion.mobi>
Date:   Fri Dec 2 16:30:11 2016 -0200

    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 ce28395..71ef715 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;
 

-- 


Reply via email to