aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-03 12:39:36 -0400
committerChris Michael <cp.michael@samsung.com>2018-07-03 12:39:36 -0400
commit48eb02422251066f68f01bc2c68f5acc59f3535c (patch)
tree49a572887e5502fe9a45f6c5ed1adf72150d7ea7 /src/bin/elementary
parentefl/selection_manager: fix some invalid memory reads (diff)
downloadefl-48eb02422251066f68f01bc2c68f5acc59f3535c.tar.gz
elm_test: fix invalid read in dnd image drop
Summary: this selection is data with a specified length, not a terminated string @fix Depends on https://phab.enlightenment.org/D6484 Reviewers: devilhorns Subscribers: netstar, cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6485
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test_dnd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/elementary/test_dnd.c b/src/bin/elementary/test_dnd.c
index 3b44c2bd40..2e5aab507f 100644
--- a/src/bin/elementary/test_dnd.c
+++ b/src/bin/elementary/test_dnd.c
@@ -1216,10 +1216,12 @@ _label_drop_cb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Selection_Data *ev)
static Eina_Bool
_image_drop_cb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Selection_Data *ev)
{
- const char *f = ev->data;
+ char *f = (char*)eina_memdup(ev->data, ev->len, 1);
+
printf("%s: obj: %s %p drop data: %s\n", __func__,
evas_object_type_get(obj), obj, f);
elm_image_file_set(obj, f, NULL);
+ free(f);
return EINA_TRUE;
}