Re: cwm crashes on Linux when combining grouponly/movetogroup

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christian Neukirchen
Date: Sunday, October 24, 2010 - 11:46 am

Christian Neukirchen <chneukirchen@gmail.com> writes:




Analyzing group_show, I found out:

	winlist = (Window *) xcalloc(sizeof(*winlist), (gc->highstack + 1));
...
	TAILQ_FOREACH(cc, &gc->clients, group_entry) {
		winlist[gc->highstack - cc->stackingorder] = cc->win;
		client_unhide(cc);
	}

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
well, it just doesn't crash there because the heap corruption goes
undetected.

I hope this helps debugging, I don't fully understand the code yet.

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
cwm crashes on Linux when combining grouponly/movetogroup, Christian Neukirchen, (Fri Oct 22, 10:16 am)
Re: cwm crashes on Linux when combining grouponly/movetogroup, Christian Neukirchen, (Sun Oct 24, 11:46 am)