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.
This commit is contained in:
Derek Foreman 2017-01-04 11:40:17 -06:00
parent 8328d4db89
commit 120063ad76
1 changed files with 4 additions and 0 deletions

View File

@ -1443,6 +1443,7 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
Ecore_Wl2_Display *display;
Eina_Inlist *l = NULL;
Ecore_Wl2_Mouse_Down_Info *info = NULL;
Ecore_Wl2_Window *window;
if (!input) return;
@ -1490,6 +1491,9 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
display->inputs =
eina_inlist_remove(display->inputs, EINA_INLIST_GET(input));
EINA_INLIST_FOREACH(display->windows, window)
if (window->input == input) window->input = NULL;
free(input);
}