Subject: Re: i386 build fails at running fc-cache
To: None <current-users@NetBSD.org>
From: Luke Mewburn <lukem@NetBSD.org>
List: current-users
Date: 02/02/2004 23:55:48
--BOKacYhQ+x31HxR3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 =3D=3D '~')
  | >      {
  | >  	FcChar8	*home =3D (FcChar8 *) getenv ("HOME");
  | > -	int	size =3D strlen ((char *) home) + strlen ((char *) s);
  | > +	int	size;
  | >  	if (!home)
  | >  	    return 0;
  | > +	size =3D strlen ((char *) home) + strlen ((char *) s);
  | >  	new =3D (FcChar8 *) malloc (size);
  | >  	if (!new)
  | >  	    return 0;
  |=20
  | 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.

--BOKacYhQ+x31HxR3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAHkjUpBhtmn8zJHIRAtMvAJ48gB0eJsB9SBhzE8ihtyQiKVN7TwCfRmDX
rlggOoakQXzuI5dvDSsIBPo=
=fbbi
-----END PGP SIGNATURE-----

--BOKacYhQ+x31HxR3--