Subject: Re: i386 build fails at running fc-cache
To: None <current-users@NetBSD.org>
From: Christian Biere <christianbiere@gmx.de>
List: current-users
Date: 02/01/2004 18:30:07
--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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;

This smells like off-by-one if not two.

--=20
Christian

--mojUlQ0s9EVzWg2t
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFAHTef0KQix3oyIMcRAmUfAKCLcTyB1sUttwi3eH2oBzn2MJXQAgCeMdRe
yfGFroqCCl8CeihI/iVjKZ8=
=T1vX
-----END PGP SIGNATURE-----

--mojUlQ0s9EVzWg2t--