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
|
||||
{
|
||||
if (data)
|
||||
if ((data) && (size > 0))
|
||||
{
|
||||
if (data_ret) *data_ret = strdup(data);
|
||||
if (size_ret) *size_ret = strlen(data);
|
||||
char *tmp = malloc(size);
|
||||
if (tmp)
|
||||
{
|
||||
memcpy(tmp, data, size);
|
||||
if (data_ret) *data_ret = tmp;
|
||||
if (size_ret) *size_ret = size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue