diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2017-10-19 20:11:39 -0500 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2017-10-20 16:10:18 +0800 |
commit | 74565380aa1c342dc2fe3ac4de0fcf72c1698ceb (patch) | |
tree | 449fecda4cd13cdb33fe9d336d7f8b084bff68c4 /src/compositor/meta-plugin-manager.c | |
parent | fa37496ffb022ec2a8241d4276297ffa560842aa (diff) | |
download | mutter-74565380aa1c342dc2fe3ac4de0fcf72c1698ceb.tar.gz |
MetaPluginManager: don't try to deference a NULL pointer when processing events
This function might be called by components with invalid plugin manager
(as it might happen to MetaWindow when the compositor isn't initialized
properly), so we need to protect ourselves from crashes.
https://bugzilla.gnome.org/show_bug.cgi?id=789223
Diffstat (limited to 'src/compositor/meta-plugin-manager.c')
-rw-r--r-- | src/compositor/meta-plugin-manager.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c index 834f678dd..9f6e67273 100644 --- a/src/compositor/meta-plugin-manager.c +++ b/src/compositor/meta-plugin-manager.c @@ -153,10 +153,17 @@ meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr, MetaWindowActor *actor, MetaPluginEffect event) { - MetaPlugin *plugin = plugin_mgr->plugin; - MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); - MetaDisplay *display = plugin_mgr->compositor->display; - gboolean retval = FALSE; + MetaPlugin *plugin; + MetaPluginClass *klass; + MetaDisplay *display; + gboolean retval; + + g_return_val_if_fail (plugin_mgr, FALSE); + + plugin = plugin_mgr->plugin; + klass = META_PLUGIN_GET_CLASS (plugin); + display = plugin_mgr->compositor->display; + retval = FALSE; if (display->display_opening) return FALSE; |