This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  3966cd2fc200bfccd12fefd1d999e6f700fd17be (commit)
      from  527f5f1730cf023e33a67b16721f92dc8bb4822a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/3966cd2fc200bfccd12fefd1d999e6f700fd17be

commit 3966cd2fc200bfccd12fefd1d999e6f700fd17be
Author: Iain Patterson <[email protected]>
Date:   Wed Jun 19 17:35:09 2013 +0100

    Don't crash when SwitchPanelImages is None.
    
    The whole changeImage() function in switchpanel.c is a no-op if
    wPreferences.swtileImage is set to None because the panel isn't actually
    drawn in that case.  As a consequence there are no images to change.
    
    As well as being logically incorrect the existing code causes a segfault
    if the user has the SwitchPanelImages preference set to None because
    changeImage() would attempt to access the icons and images arrays which
    are only initialised in wInitSwitchPanel() when swtileImage has a value.
    
    Bug report and diagnosis by Juan Giordana, Gabriel Vlasiu and Christophe
    Curis.

diff --git a/src/switchpanel.c b/src/switchpanel.c
index 62ced77..f616bfa 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -112,11 +112,19 @@ static Bool sameWindowClass(WWindow *wwin, WWindow 
*curwin)
 
 static void changeImage(WSwitchPanel *panel, int idecks, int selected, Bool 
dim, Bool force)
 {
-       WMFrame *icon = WMGetFromArray(panel->icons, idecks);
-       RImage *image = WMGetFromArray(panel->images, idecks);
-       char flags = (char) (uintptr_t) WMGetFromArray(panel->flags, idecks);
+       WMFrame *icon = NULL;
+       RImage *image = NULL;
+       char flags = 0;
        char desired = 0;
 
+       /* This whole function is a no-op if we aren't drawing the panel */
+       if (!wPreferences.swtileImage)
+               return;
+
+       icon = WMGetFromArray(panel->icons, idecks);
+       image = WMGetFromArray(panel->images, idecks);
+       flags = (char) (uintptr_t) WMGetFromArray(panel->flags, idecks);
+
        if (selected)
                desired |= ICON_SELECTED;
        if (dim)

-----------------------------------------------------------------------

Summary of changes:
 src/switchpanel.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to