forked from enlightenment/efl
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:
parent
553fd7c163
commit
48eb024222
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue