On Sun, 13 Feb 2011, Christian Neukirchen wrote:

> Catching up on this bug, which has hit some other users I know now as well.

> > For some reason cc->stackingorder is bigger than gc->highstack (which is
> > 0 in above use case), thus the assignment writes to a negative address
> > relative to winlist.  I can reproduce that on OpenBSD 4.8/cwm HEAD as

easiest fix is to apply a liberal dose of the big hammer:

Index: group.c
===================================================================
RCS file: /cvs/xenocara/app/cwm/group.c,v
retrieving revision 1.48
diff -u group.c
--- group.c     25 Sep 2010 20:01:27 -0000      1.48
+++ group.c     13 Feb 2011 02:07:37 -0000
@@ -108,6 +108,11 @@
        u_int                    i;
        int                      lastempty = -1;
 
+       gc->highstack = 0;
+       TAILQ_FOREACH(cc, &gc->clients, group_entry) {
+               if (cc->stackingorder > gc->highstack)
+                       gc->highstack = cc->stackingorder;
+       }
        winlist = (Window *) xcalloc(sizeof(*winlist), (gc->highstack + 1));
 
        /*

Reply via email to