diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-01-21 14:50:23 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-04 17:26:29 +0100 |
commit | 2951c69c49f2876eb3cc874ee3a8bab3316c3ac6 (patch) | |
tree | 4f7cc14513a6fc8f1c2a168088e04916f9c2aca3 | |
parent | 6b337ed19bce8bec149b1dbdb18281f702ba834d (diff) |
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
-rw-r--r-- | src/lib/ecore_x/ecore_x_selection.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ecore_x/ecore_x_selection.c b/src/lib/ecore_x/ecore_x_selection.c index 22cd5c8c7f..733b799244 100644 --- a/src/lib/ecore_x/ecore_x_selection.c +++ b/src/lib/ecore_x/ecore_x_selection.c | |||
@@ -990,15 +990,15 @@ _ecore_x_selection_parser_targets(const char *target EINA_UNUSED, | |||
990 | if (!sel) return NULL; | 990 | if (!sel) return NULL; |
991 | targets = data; | 991 | targets = data; |
992 | 992 | ||
993 | sel->num_targets = size - 2; | 993 | sel->num_targets = size; |
994 | sel->targets = malloc((size - 2) * sizeof(char *)); | 994 | sel->targets = malloc((sel->num_targets) * sizeof(char *)); |
995 | if (!sel->targets) | 995 | if (!sel->targets) |
996 | { | 996 | { |
997 | free(sel); | 997 | free(sel); |
998 | return NULL; | 998 | return NULL; |
999 | } | 999 | } |
1000 | for (i = 2; i < size; i++) | 1000 | for (i = 0; i < size; i++) |
1001 | sel->targets[i - 2] = XGetAtomName(_ecore_x_disp, targets[i]); | 1001 | sel->targets[i] = XGetAtomName(_ecore_x_disp, targets[i]); |
1002 | 1002 | ||
1003 | ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_targets_free; | 1003 | ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_targets_free; |
1004 | ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_TARGETS; | 1004 | ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_TARGETS; |