efl/selection_manager: fix some invalid memory reads

Summary:
these selections are data with specified lengths, not strings
Depends on D6483

Reviewers: devilhorns, bu5hm4n

Subscribers: bu5hm4n, netstar, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6484
This commit is contained in:
Mike Blumenkrantz 2018-07-03 12:39:33 -04:00 committed by Chris Michael
parent fff4d1ba97
commit 553fd7c163
1 changed files with 3 additions and 6 deletions

View File

@ -1075,11 +1075,8 @@ _x11_general_converter(char *target EINA_UNUSED, void *data, int size EINA_UNUSE
if (sel->data.mem)
{
if (data_ret)
{
*data_ret = strdup(sel->data.mem);
((char **)(data_ret))[0][sel->data.len] = 0;
}
if (size_ret) *size_ret = strlen(sel->data.mem);
*data_ret = eina_memdup(sel->data.mem, sel->data.len, 1);
if (size_ret) *size_ret = sel->data.len;
}
else
{
@ -2673,7 +2670,7 @@ _wl_selection_send(void *data, int type EINA_UNUSED, void *event)
}
else
{
data_ret = strdup(sel->data.mem);
data_ret = eina_memdup(sel->data.mem, sel->data.len, 0);
len_ret = sel->data.len;
}
break;