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

Differential Revision: https://phab.enlightenment.org/D11194
This commit is contained in:
Marcel Hollerbach 2020-01-21 14:50:23 +01:00
parent a8cb23a21a
commit 9a3bf87ee0
1 changed files with 4 additions and 4 deletions

View File

@ -990,15 +990,15 @@ _ecore_x_selection_parser_targets(const char *target EINA_UNUSED,
if (!sel) return NULL;
targets = data;
sel->num_targets = size - 2;
sel->targets = malloc((size - 2) * sizeof(char *));
sel->num_targets = size;
sel->targets = malloc((sel->num_targets) * sizeof(char *));
if (!sel->targets)
{
free(sel);
return NULL;
}
for (i = 2; i < size; i++)
sel->targets[i - 2] = XGetAtomName(_ecore_x_disp, targets[i]);
for (i = 0; i < size; 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)->content = ECORE_X_SELECTION_CONTENT_TARGETS;