aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-13 02:42:00 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-13 04:19:16 +0900
commit28d06f9a5fa2b639579ac43b590df485e0cfd650 (patch)
treea41004b2c53ed1e921bba77a95730961cd91eb32
parentefl selection - fix entry <-> plain text compy and paste in wl (diff)
downloadefl-28d06f9a5fa2b639579ac43b590df485e0cfd650.tar.gz
efl selection - fix another binary buffer treates as string bug
as per subject. @fix
-rw-r--r--src/lib/elementary/efl_selection_manager.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c
index 5b92f612ff..0a003ba4d4 100644
--- a/src/lib/elementary/efl_selection_manager.c
+++ b/src/lib/elementary/efl_selection_manager.c
@@ -1166,9 +1166,17 @@ _x11_text_converter(char *target, void *data, int size EINA_UNUSED, void **data_
if ((sel->format & EFL_SELECTION_FORMAT_MARKUP) ||
(sel->format & EFL_SELECTION_FORMAT_HTML))
{
- *data_ret = _elm_util_mkup_to_text(sel->data.mem);
- if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
- sel_debug("markup or html: %s", (const char *)*data_ret);
+ char *tmp = malloc(size + 1);
+ if (tmp)
+ {
+ strncpy(tmp, data, size);
+ tmp[size] = 0;
+ *data_ret = _elm_util_mkup_to_text(tmp);
+ if (size_ret && *data_ret) *size_ret = strlen(*data_ret);
+ free(tmp);
+ sel_debug("markup or html: %s", (const char *)*data_ret);
+ }
+ else return EINA_FALSE;
}
else if (sel->format & EFL_SELECTION_FORMAT_TEXT)
{