cedric pushed a commit to branch master.

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

commit b7840d9177b32f480087bd7f062cc66ab2583485
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Mon Aug 7 10:32:19 2017 -0700

    eo: temporary prevent segfault.
    
    In some case, detected during eo test suite, the vtable does fail to
    be fully assigned, but it is still being assigned as the new vtable.
    Of course when later destroying it, it has already been freed. Leading
    to a double free.
---
 src/lib/eo/eo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index a567a00d44..cd73df811a 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1642,6 +1642,8 @@ efl_object_override(Eo *eo_id, const Efl_Object_Ops *ops)
           {
              // FIXME: Maybe leaking some chain stuff from copy above?
              ERR("Failed to override functions for %p", eo_id);
+             if (obj->opt->vtable == vtable)
+               EO_OPTIONAL_COW_SET(obj, vtable, NULL);
              free(vtable);
              goto err;
           }

-- 


Reply via email to