Christopher Wolf <cwolf_at_micro.ti.com> wrote:
> If one creates an FvwmButtons button and specifies actions for mouse 1
> and mouse 2, and then presses mouse 3 on it, the entire FvwmButtons
> will die.
It seems that in the situation you describe a NULL pointer gets passed
to mystrncasecmp() which calls strlen() on it without checking and
that causes the segmentation fault.
> Granted, this can be prevented by specifying a mouse 3
> action or a default action, but couldn't it also just beep or
> something if there is no action? Segfaulting seems a little harsh.
Attached is a patch which hopefully does what you want. Maybe it would
also be a good idea to make mystrncasecmp() more robust?
By the way: I was looking around the code to see if how fvwm does the beeping.
I found that it always calls XBell(dpy,Scr.screen). I just don't understand
why this is better than XBell(dpy, 0). What am I missing?
Cheers,
Thomas
--- FvwmButtons.c~ Tue Jun 24 10:15:56 1997
+++ FvwmButtons.c Tue Jun 24 19:52:41 1997
_at_@ -597,6 +597,11 @@
RedrawButton(b,0);
if(!(act=GetButtonAction(b,Event.xbutton.button)))
act=GetButtonAction(b,0);
+ if (!act)
+ {
+ XBell(Dpy, 0);
+ break;
+ }
if(mystrncasecmp(act,"popup",5)!=0)
break;
else /* i.e. action is Popup */
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Tue Jun 24 1997 - 16:58:59 BST