forked from enlightenment/efl
ecore_x_selection: do not skip any any atoms
i dont know why we skipped the first two atoms, but right now, if a application is only providing one single target, we would crash. With this we might copy a few atoms more. However, these atoms do not matter, as we skip those, that we cannot understand Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11194
This commit is contained in:
parent
293b2fe719
commit
6189c2112c
|
@ -990,15 +990,15 @@ _ecore_x_selection_parser_targets(const char *target EINA_UNUSED,
|
||||||
if (!sel) return NULL;
|
if (!sel) return NULL;
|
||||||
targets = data;
|
targets = data;
|
||||||
|
|
||||||
sel->num_targets = size - 2;
|
sel->num_targets = size;
|
||||||
sel->targets = malloc((size - 2) * sizeof(char *));
|
sel->targets = malloc((sel->num_targets) * sizeof(char *));
|
||||||
if (!sel->targets)
|
if (!sel->targets)
|
||||||
{
|
{
|
||||||
free(sel);
|
free(sel);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (i = 2; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
sel->targets[i - 2] = XGetAtomName(_ecore_x_disp, targets[i]);
|
sel->targets[i] = XGetAtomName(_ecore_x_disp, targets[i]);
|
||||||
|
|
||||||
ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_targets_free;
|
ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_targets_free;
|
||||||
ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_TARGETS;
|
ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_TARGETS;
|
||||||
|
|
Loading…
Reference in New Issue