forked from enlightenment/efl
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
This commit is contained in:
parent
1358879201
commit
abdd34e1de
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue