From fe0672f78385e8159f43f1b1ea619a8bf5d5477b Mon Sep 17 00:00:00 2001 From: Chidambar Zinnoury Date: Sun, 24 Jun 2012 05:35:49 +0000 Subject: [PATCH] e window list: prevent from segfaulting, patch from andrej. Description from Trac (see #1020): Pressing a key which is bound to "next/previous window of the same class" can make Enlightenment SEGV. This happens when: Window switcher list module is loaded the key is pressed when the active desktop is empty (i.e., contains no windows / applications) and at least one other desktop contains one or several windows This does not happen if all the desktops are empty. Fixes #1020. SVN revision: 72753 --- src/modules/winlist/e_winlist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index 450ce49a6..5ab6d5d03 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c @@ -180,10 +180,12 @@ e_winlist_show(E_Zone *zone, E_Winlist_Filter filter) switch (filter) { case E_WINLIST_FILTER_CLASS_WINDOWS: - pick = !strcmp(_last_border->client.icccm.class, - bd->client.icccm.class); + if (!_last_border) + pick = EINA_FALSE; + else + pick = !strcmp(_last_border->client.icccm.class, + bd->client.icccm.class); break; - case E_WINLIST_FILTER_CLASSES: pick = (!_wmclass_picked(wmclasses, bd->client.icccm.class)); if (pick)