Date: Mon, 31 Mar 2014 10:00:01 GMT From: David Chisnall <theraven@FreeBSD.org> To: freebsd-standards@FreeBSD.org Subject: Re: standards/188036: mblen(3) in EUC locales causes crash and segmentation fault. Message-ID: <201403311000.s2VA01OB035234@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/188036; it has been noted by GNATS. From: David Chisnall <theraven@FreeBSD.org> To: Tomohisa Tanaka <tomohisa.tanaka@gmail.com> Cc: freebsd-gnats-submit@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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403311000.s2VA01OB035234>