mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-25 16:02:33 +01:00
Prevent crash when switchpanel is not initialised.
A while loop in StartWindozeCycle() was checking the value of the panel pointer and setting a flag to break out of the loop if it were NULL. The current iteration of the loop was allowed to continue, however, with the result that the null pointer could be passed to one of the switchpanel functions and cause a segfault. To reproduce, close all windows except one. Open the inspector and set the window's "Do not show in the switch panel" flag. Then close the inspector and press alt-tab to open the switchpanel. As there is only one window and it is not allowed to appear in the switchpanel, a null panel pointer is returned, then later passed to wSwitchPanelSelectNext() causing wmaker to crash. The fix is to break out of the loop immediately instead of setting the done flag.
This commit is contained in:
committed by
Carlos R. Mafra
parent
936a85ce25
commit
bf9e025289
@@ -152,7 +152,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl
|
||||
modifiers = ev.xkey.state & ValidModMask;
|
||||
|
||||
if (!swpanel)
|
||||
done = True;
|
||||
break;
|
||||
|
||||
switch (ev.type) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user