forked from enlightenment/efl
fix seb "fix" commit that causes lots of segvs.
this fixes 04e0a6d95e
which introduced
copy & paste segv's by properly terminating the right buffer.
This commit is contained in:
parent
b10dcb5c23
commit
82841fefe3
File diff suppressed because one or more lines are too long
|
@ -599,13 +599,11 @@ ecore_x_selection_converter_text(char *target,
|
||||||
&text_prop) == Success)
|
&text_prop) == Success)
|
||||||
{
|
{
|
||||||
int bufsize = strlen((char *)text_prop.value);
|
int bufsize = strlen((char *)text_prop.value);
|
||||||
*data_ret = malloc(bufsize + 1);
|
char *s = malloc(bufsize + 1);
|
||||||
if (!*data_ret)
|
if (!s) return EINA_FALSE;
|
||||||
{
|
*data_ret = s;
|
||||||
return EINA_FALSE;
|
memcpy(s, text_prop.value, bufsize);
|
||||||
}
|
s[bufsize] = 0;
|
||||||
memcpy(*data_ret, text_prop.value, bufsize);
|
|
||||||
((char **)data_ret)[bufsize] = 0;
|
|
||||||
*size_ret = bufsize;
|
*size_ret = bufsize;
|
||||||
XFree(text_prop.value);
|
XFree(text_prop.value);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
Loading…
Reference in New Issue