[Lcdproc] CVS stable-0-4-3: Status

Ethan Dicks erd@iname.com
Tue May 14 05:45:01 2002

--- Guillaume Filion <gfk@logidac.com> wrote:
> At 12:26 -0700 13/05/02, Ethan Dicks wrote:
> >As I said in an earlier message, the behavior of strlen()...
> >you pass it a NULL pointer... Under Solaris... it typically segfaults.
> It seem to me that the pointer 's' is checked:

s is checked, but not s->name.  If the pointer "name" in the struct that s
points to is NULL, you will see this behavior.  It shouldn't be the timeout
element, because that's a "%d" in the printf specifier.

> -----
> /* Check to see if the screen has a timeout value, if it does
> * decrese it and then check to see if it has excpired.
> * Remove if expired.
> */
> if((message = malloc(256)) == NULL)
> 	report(RPT_ERR, "Error allocating message string");
> else if (s) {
> 	snprintf(message, 256, "Screen->%s has timeout->%d", s->name, 
> s->timeout);
> 	report(RPT_DEBUG, message);
> 	free(message);
> }

Not sure what you'd want to display if "s->name" is null.  Some OSes
actually print "NULL" when you feed a null to a "%s" in a (sn)printf.
Solaris is not so generous.


Visit "The Seventh Continent"

Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience