Subject: Re: `Direction' core dumps

From: Dominik Vogt <[email-masked]>
Date: Wed, 10 Feb 1999 19:36:35 +0100

On Fri, Feb 05, 1999 at 04:42:44AM -0600, [email-masked] wrote:
> Full_Name: Ives Aerts
> Version: 2.1.10
> CVS_Date: 
> OS: IRIX 6.3
> X_Server: 
> Submission from: (NULL) (193.74.243.52)
> 
> 
> Due to the word wrapping of my editor, I ended up with the
> following line in my .fvwm2rc:
> 
>   key h   A       MC      Direction West      (!Iconic CurrentPage
> 

> I restarted fvwm2 and got a proper complaint:
> 
>   [FVWM][CreateConditionMask]: <<ERROR>> Conditionals require closing
> parenthesis
> 
> but when I tried meta-control-h anyway (I hadn't read the
> mesage yet), fvwm2 core dumped on me.

One thing to soothe you conscience ;-) : The error message is
printed when you press the key combination, so you couldn't have
seen it before the coredump even if you wanted.

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

--
Visit the official FVWM web page at <URL:http://fvwm.math.uh.edu/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 10 Feb 1999 19:35:48 +0100

On Mon, Feb 08, 1999 at 02:11:27PM +0100, Ives Aerts wrote:
> On Mon, Feb 08, 1999 at 01:36:10PM +0100, Dominik Vogt wrote:
> > Could you change this to
> > [snip]
> > And see if Action is a NULL pointer?
> 
> It seems to be even worse:
> 
>   Action = 0x00000009
>   ÿÿÿÿSegmentation fault (core dumped)

OK, I see where the problem is. In fact there are five problems:

1) DirectionFunc (builtins.c) may pass an invalid pointer because
   it assumes that

     flags = CreateFlagString(action, &restofline);

   always returns sensible values. It happily continues with
   whatever it gets back and even passes a NULL pointer to
   ExecuteFunction (functions.c).

2) ExecuteFunction accesses any action it gets, even NULL pointers.

3) CreateFlagString doesn't touch the 'restofline' return parameter
   if it fails. I.e. whatever value was in there before is finally
   passed to ExecuteFunction.

4) Other code relies of CreateFlagString to work.

5) Other code relies on ExecuteFunction to handle NULL pointers.

Summary:

  :-(

I don't see a way how we can release 2.2 without fixing these
problems. I will create a patch and post it on the list. On the
other hand the fixes are really trivial so I'd accept if we
Apply them, let Ives verify that the fix his problem and include
the in 2.2 without further testing.

Bye

Dominik