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 D6484

Reviewers: devilhorns

Subscribers: netstar, cedric, #committers

Tags: #efl

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

View File

@ -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;
}