hermet pushed a commit to branch master.

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

commit 58e09586bf3e4cdd606f955b8c2ea5eb315f94ad
Author: Hermet Park <hermetp...@gmail.com>
Date:   Mon Nov 25 13:26:52 2019 +0900

    evas vector: initialize data member properly.
    
    user entry root should be initialized to null before accessing it.
    
    in a certain scenario it could occur a crash with an invalid root data.
    
    @fix
---
 src/lib/evas/canvas/efl_canvas_vg_object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c 
b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 52215200a7..2b66d17109 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -152,14 +152,14 @@ _efl_canvas_vg_object_root_node_set(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Data *pd, E
      {
         if (!pd->user_entry)
           {
-             pd->user_entry = malloc(sizeof(Vg_User_Entry));
+             pd->user_entry = calloc(1, sizeof(Vg_User_Entry));
              if (!pd->user_entry)
                {
                   ERR("Failed to alloc user entry data while setting root 
node");
                   return;
                }
           }
-        pd->user_entry->w = pd->user_entry->h = 0;
+        else pd->user_entry->w = pd->user_entry->h = 0;
 
         efl_replace(&pd->user_entry->root, root_node);
         efl_canvas_vg_node_vg_obj_set(root_node, eo_obj, pd);

-- 


Reply via email to