Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Aug 2015 18:35:56 +0200
From:      Baptiste Daroussin <bapt@freebsd.org>
To:        Ed Schouten <ed@nuxi.nl>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers <src-committers@freebsd.org>
Subject:   Re: svn commit: r286490 - head/lib/libc/locale
Message-ID:  <20150811163554.GC10390@ivaldir.etoilebsd.net>
In-Reply-To: <CABh_MKnnZ7g3kKs1n-xft4tH8m5vrPhDsvQR7CyyGYk_mUrvHw@mail.gmail.com>
References:  <201508082359.t78NxGGZ026906@repo.freebsd.org> <CABh_MKnnZ7g3kKs1n-xft4tH8m5vrPhDsvQR7CyyGYk_mUrvHw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--lkTb+7nhmha7W+c3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 11, 2015 at 06:27:01PM +0200, Ed Schouten wrote:
> 2015-08-09 1:59 GMT+02:00 Baptiste Daroussin <bapt@freebsd.org>:
> >   Remove 5 and 6 bytes sequences which are illegal in UTF-8 space.
> >
> >   Per rfc3629 value greater than 0x10ffff should be rejected
>=20
> I think the change you made only ensures that the value cannot exceed
> 0x1fffff -- not 0x10ffff. You probably need to do something like this:
>=20
> diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c
> index 55e2931..8ccfdb1 100644
> --- a/lib/libc/locale/utf8.c
> +++ b/lib/libc/locale/utf8.c
> @@ -191,7 +191,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char
> * __restrict s, size_t n,
>   errno =3D EILSEQ;
>   return ((size_t)-1);
>   }
> - if (wch >=3D 0xd800 && wch <=3D 0xdfff) {
> + if ((wch >=3D 0xd800 && wch <=3D 0xdfff) || wch > 0x10ffff) {
>   /*
>   * Malformed input; invalid code points.
>   */

Please go ahead with that one.

Best regards,
Bapt

--lkTb+7nhmha7W+c3
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlXKJGoACgkQ8kTtMUmk6Ex7CgCgqaMpjq7qo4B2tNT9ngBRP1Vy
V3QAmgPlvaMiAiqQEH5ebnlxgkvIibWv
=Bmjl
-----END PGP SIGNATURE-----

--lkTb+7nhmha7W+c3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150811163554.GC10390>