jaehyun pushed a commit to branch master.

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

commit aee7d74b156ad65305a62e06c2cc1fcc45c7d84a
Author: Yeongjong Lee <yj34....@samsung.com>
Date:   Mon Apr 13 19:50:43 2020 +0900

    eo: null check for vtable allocation
    
    Reviewers: bu5hm4n, Jaehyun_Cho
    
    Reviewed By: Jaehyun_Cho
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D11687
---
 src/lib/eo/eo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 4d3469c428..b93497372c 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -906,6 +906,7 @@ efl_class_functions_set(const Efl_Class *klass_id, const 
Efl_Object_Ops *object_
    klass->class_id = _UNMASK_ID(klass->header.id) - 1;
 
    _vtable_init(&klass->vtable);
+   if (!klass->vtable.chain) goto err_vtable;
 
    hitmap = alloca(klass->vtable.size);
    memset(hitmap, 0, klass->vtable.size);
@@ -980,6 +981,9 @@ err_funcs:
 err_klass:
    _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id);
    return EINA_FALSE;
+err_vtable:
+   ERR("failed to allocate vtable for class '%s'", klass->desc->name);
+   return EINA_FALSE;
 }
 
 static Eo *

-- 


Reply via email to