standards/188036: mblen(3) in EUC locales causes crash and segmentation fault.

David Chisnall theraven at FreeBSD.org
Mon Mar 31 10:00:01 UTC 2014


The following reply was made to PR standards/188036; it has been noted by GNATS.

From: David Chisnall <theraven at FreeBSD.org>
To: Tomohisa Tanaka <tomohisa.tanaka at gmail.com>
Cc: freebsd-gnats-submit at FreeBSD.org
Subject: Re: standards/188036: mblen(3) in EUC locales causes crash and segmentation fault.
Date: Mon, 31 Mar 2014 10:57:01 +0100

 On 31 Mar 2014, at 10:03, David Chisnall <theraven at FreeBSD.org> wrote:
 
 > I think the fix should actually be:
 >=20
 > Index: locale/euc.c
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > --- locale/euc.c	(revision 263226)
 > +++ locale/euc.c	(working copy)
 > @@ -134,7 +134,7 @@
 > 	return (ps =3D=3D NULL || ((const _EucState *)ps)->want =3D=3D =
 0);
 > }
 >=20
 > -#define	CEI	((_EucInfo *)(_CurrentRuneLocale->__variable))
 > +#define	CEI	((_EucInfo =
 *)(__getCurrentRuneLocale()->__variable))
 >=20
 > #define	_SS2	0x008e
 > #define	_SS3	0x008f
 >=20
 >=20
 >=20
 > Please can you test this and let me know if it fixes it for you?
 
 Actually, I'm not sure how this bug can manifest, unless you've somehow =
 built libc with the wrong headers.  In runtype.h (which is included in =
 euc.c), we have this:
 
 #define _CurrentRuneLocale (__getCurrentRuneLocale())
 
 So these two versions should expand to the same thing. =20
 
 David
 


More information about the freebsd-standards mailing list