x11: Prevent use-after-free if a filter is removed during handling
Keep a pointer to the next element, to protect against filters removing themselves. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2640 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2868>
This commit is contained in:
parent
bac7b3f4e6
commit
53126bf008
@ -2523,11 +2523,14 @@ meta_x11_display_run_event_funcs (MetaX11Display *x11_display,
|
||||
XEvent *xevent)
|
||||
{
|
||||
MetaX11EventFilter *filter;
|
||||
GList *l;
|
||||
GList *next, *l = x11_display->event_funcs;
|
||||
|
||||
for (l = x11_display->event_funcs; l; l = l->next)
|
||||
while (l)
|
||||
{
|
||||
filter = l->data;
|
||||
next = l->next;
|
||||
|
||||
filter->func (x11_display, xevent, filter->user_data);
|
||||
l = next;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user