Summary:
A crash could happen on a bad call to free() context_dup() returns a
newly malloc'ed context if passed NULL (this seems dubious to me, why
not calloc?).
@fix
Test Plan:
Add an empty efl.ui.text object
Set markup text as "<gfx_filter='code'>Hello</>"
Reviewers: cedric, segfaultxavi, Jaehyun, herdsman, zmike
Reviewed By: zmike
Subscribers: zmike, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7368
fmt2->gfx_filter = malloc(sizeof(*fmt2->gfx_filter));
memcpy(fmt2->gfx_filter, fmt->gfx_filter, sizeof(*fmt->gfx_filter));
fmt2->gfx_filter->name = eina_stringshare_ref(fmt->gfx_filter->name);
- fmt2->gfx_filter->dc = ENFN->context_dup(ENC, fmt->gfx_filter->dc);
+ if (fmt->gfx_filter->dc)
+ fmt2->gfx_filter->dc = ENFN->context_dup(ENC, fmt->gfx_filter->dc);
}
return fmt2;