aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-12 23:59:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-04-13 04:19:16 +0900
commit9d6ac24a9c09d90a16435faee97192da21fc7f87 (patch)
tree9e033753db7721d7e9ee6007ae010e2ed4a6750b
parentefl selection manager - fix crashes when doing selections on non-x11 (diff)
downloadefl-9d6ac24a9c09d90a16435faee97192da21fc7f87.tar.gz
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
-rw-r--r--src/lib/elementary/efl_selection_manager.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c
index 5bdf7ff6ec..52edb97fd8 100644
--- a/src/lib/elementary/efl_selection_manager.c
+++ b/src/lib/elementary/efl_selection_manager.c
@@ -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
{