forked from enlightenment/efl
efl selection manager - fix anoyther binary buffer treated as string bug
yet another "binary buffer" (pointer + size) streated as a string with strdup + strlen which is oh so wrong. this fixes up some cnp in wayland with garbage at the end of strings @fix
This commit is contained in:
parent
59f3dbdd34
commit
9d6ac24a9c
|
@ -2384,10 +2384,15 @@ _wl_general_converter(char *target, Sel_Manager_Selection *sel, void *data, int
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (data)
|
if ((data) && (size > 0))
|
||||||
{
|
{
|
||||||
if (data_ret) *data_ret = strdup(data);
|
char *tmp = malloc(size);
|
||||||
if (size_ret) *size_ret = strlen(data);
|
if (tmp)
|
||||||
|
{
|
||||||
|
memcpy(tmp, data, size);
|
||||||
|
if (data_ret) *data_ret = tmp;
|
||||||
|
if (size_ret) *size_ret = size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue