From owner-svn-src-head@freebsd.org Tue Aug 11 16:34:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D1F899E2D3; Tue, 11 Aug 2015 16:34:07 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5954155; Tue, 11 Aug 2015 16:34:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by wijp15 with SMTP id p15so183947970wij.0; Tue, 11 Aug 2015 09:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=WSXba7pZfyU9f4hhASgnqPiGfSWSXhd9isq7qWFc/ao=; b=xAZG5NI0cMScXQ69v8o092ZEwCITQRILRlciYLEfdzuWPIHHhbNEFB9DFQna3eKc4l GlcH+aj46poAyQXiAKuIbobHeA8K3WRgtKkhEZx73xBmpU/Xqzghj+aDPHTPiRfn7Wrw TGOZFt9nRvvXpst18TIMxCBGAgSLWThRQsf763dVIepra3YkPGH98cNOAIwi42fTcy0o tFs2JZy0GPjArFdnS0efSB5lVfMMpDalBiaBwFys1s8PiGsfm95W0/hc6EjOoR1jkrFV M33/CWWCG4a3Aqmt02TsyFOErJK6fE/4w6M4mRAaR5ITe3qv4o3lA0h1pLrSb6Vo8oV0 uVYQ== X-Received: by 10.194.238.168 with SMTP id vl8mr59962138wjc.128.1439310845123; Tue, 11 Aug 2015 09:34:05 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id g13sm3756938wjs.21.2015.08.11.09.34.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 09:34:04 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 11 Aug 2015 18:34:02 +0200 From: Baptiste Daroussin To: Ed Schouten Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r286491 - head/lib/libc/locale Message-ID: <20150811163314.GB10390@ivaldir.etoilebsd.net> References: <201508090006.t7906vbK031238@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W5WqUoFLvi1M7tJE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 16:34:07 -0000 --W5WqUoFLvi1M7tJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 11, 2015 at 06:28:06PM +0200, Ed Schouten wrote: > 2015-08-09 2:06 GMT+02:00 Baptiste Daroussin : > > Per rfc3629 value greater than 0x10ffff should be rejected >=20 > Not only that, values between 0xd800 and 0xdfff also need to be rejected: >=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 > @@ -318,6 +318,10 @@ _UTF8_wcrtomb(char * __restrict s, wchar_t wc, > mbstate_t * __restrict ps) > lead =3D 0xc0; > len =3D 2; > } else if ((wc & ~0xffff) =3D=3D 0) { > + if (wc >=3D 0xd800 && wc <=3D 0xdfff) { > + errno =3D EILSEQ; > + return ((size_t)-1); > + } > lead =3D 0xe0; > len =3D 3; > } else if (wc >=3D 0 && wc <=3D 0x10ffff) { Good catch please go ahead Bapt --W5WqUoFLvi1M7tJE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXKI/kACgkQ8kTtMUmk6EwOhwCfdFSCi8nWDVRI59hxO4dASTUK 4kcAn3GEXDSOaRZ1Lte6EuAaPWGrz/MF =xnk5 -----END PGP SIGNATURE----- --W5WqUoFLvi1M7tJE--