xwayland dnd - handle names not being allocated

fix CID 1403921
This commit is contained in:
Carsten Haitzler 2019-08-06 19:20:03 +01:00
parent 8c76ff3e32
commit e96cff8503
1 changed files with 45 additions and 41 deletions

View File

@ -186,6 +186,8 @@ _xwl_fixes_selection_notify(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Even
Ecore_X_Atom *types = (void*)data;
names = malloc(num * sizeof(void*));
if (names)
{
namelist = eina_array_new(num);
for (i = 0; i < num; i++)
{
@ -206,9 +208,11 @@ _xwl_fixes_selection_notify(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Even
ecore_x_window_prop_property_set(e_comp->cm_selection,
ECORE_X_ATOM_XDND_TYPE_LIST, ECORE_X_ATOM_ATOM, 32, names, num);
}
}
free(data);
}
if (names)
{
evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
e_comp_wl->drag_client = e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner);
if (!e_comp_wl->drag_client) e_comp_wl->drag_client = e_comp_wl->ptr.ec;
@ -229,10 +233,10 @@ _xwl_fixes_selection_notify(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Even
source->send = _xwayland_send_send;
source->cancelled = _xwayland_cancelled_send;
source->mime_types = namelist;
for (i = 0; i < num; i++)
free(names[i]);
for (i = 0; i < num; i++) free(names[i]);
free(names);
}
}
else
{
if (e_comp_wl->drag &&