summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-03-10 11:04:03 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-03-10 11:04:03 -0500
commit60ca712654d58998e62d621b3a586abb151c6868 (patch)
treebf07f277fa50f40aa560b146360dca63e7aab2a5
parent22eefc9626e15e78612396a9c7adca89ffc228e2 (diff)
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
-rw-r--r--src/lib/elm_color_class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/elm_color_class.c b/src/lib/elm_color_class.c
index c2ea17cc0..856f59062 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)
212 } 212 }
213 else 213 else
214 { 214 {
215 cc->current = malloc(sizeof(Elm_Color_Overlay)); 215 cc->current = calloc(1, sizeof(Colorclass)); //actually Elm_Color_Overlay
216 memcpy(cc->current, ecc, sizeof(Elm_Color_Overlay)); 216 memcpy(cc->current, ecc, sizeof(Elm_Color_Overlay));
217 cc->current->name = eina_stringshare_ref(ecc->name); 217 cc->current->name = eina_stringshare_ref(ecc->name);
218 } 218 }