summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-01-04 11:40:17 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-01-05 13:40:31 -0600
commit120063ad76eac855ef87d87bba0fd82ba665d68f (patch)
treeec0f1c1f2fcc2478c73fa7e9d983b3925b96c368 /src/lib/ecore_wl2/ecore_wl2_input.c
parent8328d4db89d0d422677a62de890c10d0180a86f8 (diff)
ecore_wl2: Prevent use after free on input deletion
Window structs keep inputs around, so we should sweep through them and NULL out any stale ones on a delete.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index c2fbe48144..3e7fd98753 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1443,6 +1443,7 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
1443 Ecore_Wl2_Display *display; 1443 Ecore_Wl2_Display *display;
1444 Eina_Inlist *l = NULL; 1444 Eina_Inlist *l = NULL;
1445 Ecore_Wl2_Mouse_Down_Info *info = NULL; 1445 Ecore_Wl2_Mouse_Down_Info *info = NULL;
1446 Ecore_Wl2_Window *window;
1446 1447
1447 if (!input) return; 1448 if (!input) return;
1448 1449
@@ -1490,6 +1491,9 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
1490 display->inputs = 1491 display->inputs =
1491 eina_inlist_remove(display->inputs, EINA_INLIST_GET(input)); 1492 eina_inlist_remove(display->inputs, EINA_INLIST_GET(input));
1492 1493
1494 EINA_INLIST_FOREACH(display->windows, window)
1495 if (window->input == input) window->input = NULL;
1496
1493 free(input); 1497 free(input);
1494} 1498}
1495 1499