discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=60ca712654d58998e62d621b3a586abb151c6868

commit 60ca712654d58998e62d621b3a586abb151c6868
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Thu Mar 10 11:04:03 2016 -0500

    colorclass: allocate memory to fit the original size of data type
    
    Summary:
    The size of Colorclass is 20 bytes, but that of Elm_Color_Overlay 16 bytes.
    Currently, there is no code to access last 4 bytes, but it can cause
    seg fault by another patch.
    
    Reviewers: cedric, zmike
    
    Differential Revision: https://phab.enlightenment.org/D3784
---
 src/lib/elm_color_class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elm_color_class.c b/src/lib/elm_color_class.c
index c2ea17c..856f590 100644
--- a/src/lib/elm_color_class.c
+++ b/src/lib/elm_color_class.c
@@ -212,7 +212,7 @@ _colorclass_activate(void *data, const Eo_Event *event)
      }
    else
      {
-        cc->current = malloc(sizeof(Elm_Color_Overlay));
+        cc->current = calloc(1, sizeof(Colorclass)); //actually 
Elm_Color_Overlay
         memcpy(cc->current, ecc, sizeof(Elm_Color_Overlay));
         cc->current->name = eina_stringshare_ref(ecc->name);
      }

-- 


Reply via email to