Subject: Re: i386 build fails at running fc-cache
To: Luke Mewburn <lukem@NetBSD.org>
From: Aidan Kehoe <kehoea@parhasard.net>
List: current-users
Date: 02/02/2004 13:04:22
 Ar an 2ú lá de mí 2, scríobh Luke Mewburn :

 > On Sun, Feb 01, 2004 at 06:30:07PM +0100, Christian Biere wrote:
 >   | Masao Uebayashi wrote:
 >   | > diff -u -r1.1.1.1 fcstr.c
 >   | > --- src/fcstr.c	28 Feb 2003 13:18:57 -0000	1.1.1.1
 >   | > +++ src/fcstr.c	1 Feb 2004 13:26:24 -0000
 >   | > @@ -428,9 +428,10 @@
 >   | >      if (*s == '~')
 >   | >      {
 >   | >  	FcChar8	*home = (FcChar8 *) getenv ("HOME");
 >   | > -	int	size = strlen ((char *) home) + strlen ((char *) s);
 >   | > +	int	size;
 >   | >  	if (!home)
 >   | >  	    return 0;
 >   | > +	size = strlen ((char *) home) + strlen ((char *) s);
 >   | >  	new = (FcChar8 *) malloc (size);
 >   | >  	if (!new)
 >   | >  	    return 0;
 >   | 
 >   | This smells like off-by-one if not two.
 > 
 > It failed because $HOME wasn't set, so strlen((char*)home) dumped core ...
 > That's what the patch is working around.

Yeah. The off-by-two bug is a seperate issue. 

-- 
I don't care if it rains or freezes/'Long as I got my Plastic Jesus
Riding on the dashboard of my car.