From owner-svn-src-projects@freebsd.org Sun Aug 9 10:36:25 2015 Return-Path: Delivered-To: svn-src-projects@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 EFA2D998A88 for ; Sun, 9 Aug 2015 10:36:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC7A4F29; Sun, 9 Aug 2015 10:36:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t79AaPqi066035; Sun, 9 Aug 2015 10:36:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t79AaPvc066034; Sun, 9 Aug 2015 10:36:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508091036.t79AaPvc066034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 9 Aug 2015 10:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r286518 - projects/collation/lib/libc/locale X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2015 10:36:26 -0000 Author: bapt Date: Sun Aug 9 10:36:25 2015 New Revision: 286518 URL: https://svnweb.freebsd.org/changeset/base/286518 Log: Readd checking utf16 surrogates that are invalid in utf8 Modified: projects/collation/lib/libc/locale/utf8.c Modified: projects/collation/lib/libc/locale/utf8.c ============================================================================== --- projects/collation/lib/libc/locale/utf8.c Sun Aug 9 10:24:24 2015 (r286517) +++ projects/collation/lib/libc/locale/utf8.c Sun Aug 9 10:36:25 2015 (r286518) @@ -193,6 +193,13 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, errno = EILSEQ; return ((size_t)-1); } + if (wch >= 0xd800 && wch <= 0xdfff) { + /* + * Malformed input; invalid code points. + */ + errno = EILSEQ; + return ((size_t)-1); + } if (pwc != NULL) *pwc = wch; us->want = 0;