From 103df63023846977124d7ac0221321a0da7518ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 29 Nov 2016 16:13:21 +0800 Subject: [PATCH] MetaWindow: Clear fullscreen monitors when monitors change The fullscreen monitors state is set given a set of xinerama monitor identification numbers. When the monitor configuration changes (e.g. by a hotplug event) these are no longer valid, and may point to uninitialized or unallocated data. Avoid accessing uninitialized/unallocated memory by clearing the fullscreen monitor state when the monitor configuration changes. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/core/window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/window.c b/src/core/window.c index 0b017062d..ed0bef0df 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3540,6 +3540,9 @@ meta_window_update_for_monitors_changed (MetaWindow *window) { const MetaLogicalMonitor *old, *new; + if (window->fullscreen_monitors[0] != -1) + window->fullscreen_monitors[0] = -1; + if (window->override_redirect || window->type == META_WINDOW_DESKTOP) { meta_window_update_monitor (window, FALSE);