diff options
author | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2006-12-12 18:30:27 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2006-12-12 18:30:27 +0000 |
commit | ea137d35f3c778a2d00a773ae02b440c6683de74 (patch) | |
tree | 6dcbf1682a9f8815ff3add741d5ebcd571af1e9c | |
parent | 54b0105ffaf1bf9d23e64fd325ded50fd3d14589 (diff) | |
download | metacity-ea137d35f3c778a2d00a773ae02b440c6683de74.tar.gz |
Sanity check to avoid dereferencing a null pointer.
* src/compositor.c (do_effect): Sanity check to avoid dereferencing
a null pointer.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/compositor.c | 9 |
2 files changed, 14 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2006-12-12 Thomas Thurman <thomas@thurman.org.uk> + + * src/compositor.c (do_effect): Sanity check to avoid dereferencing + a null pointer. + 2006-12-10 Thomas Thurman <thomas@thurman.org.uk> * configure.in: post-release bump to 2.17.5. diff --git a/src/compositor.c b/src/compositor.c index 05b4e1fb..1b8ed6b0 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -121,6 +121,15 @@ do_effect (MetaEffect *effect, MetaCompWindow *window; screen = meta_comp_screen_get_by_xwindow (get_xid (effect->window)); + + if (!screen) + { + /* sanity check: if no screen is found, bail */ + meta_warning ("No screen found for %s (%ld); aborting effect.\n", + effect->window->desc, get_xid (effect->window)); + return; + } + window = meta_comp_screen_lookup_window (screen, get_xid (effect->window)); switch (effect->type) |