From owner-svn-src-all@freebsd.org Tue Aug 11 16:27:08 2015 Return-Path: Delivered-To: svn-src-all@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 04DC599E0BE for ; Tue, 11 Aug 2015 16:27:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171]) (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 CB4E3A47 for ; Tue, 11 Aug 2015 16:27:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by obbfr1 with SMTP id fr1so115400868obb.1 for ; Tue, 11 Aug 2015 09:27:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=XqoTEYr5omPTjyjFuO9ixrquGo23PwFGnT/38+PxlMA=; b=cQSE7MZDOqy95BtLL03Kt+dRRdegUDoU0rb0MzoB3UzKydNAalFnvVLQWpRg4QEUzn R/q3uoq7mE/PNaH8dbCRR+asjNa3pgkye/heeaRgF6/RRV4zeY2F0xdWsfT/1PIKNGzO t10UxeRZDVoYKv40Fh3NZviQicIalY+ceNQ638Sdft2ifHsmXQo8mgnbiSJqBVyS1oUe ClfiO0moh//mHB4z3B9GyhePQ7ftetjcW3LUFbvm2VRVgmOKfGl5PW/b9LjOzAhJcVSM KdzfOmfkxmZRlrBILjfS6YD4+SrZyiSoXI5EuUMXRuG1vezY4MB45xOdunPyfER4QCK8 +n5g== X-Gm-Message-State: ALoCoQlQ1TQewdvuW0qBkGOyv1akDa8GLUSXRDmDFhFNi9AyJdADEz2Pb1IT0FSdLbrnaCyM0ZK7 MIME-Version: 1.0 X-Received: by 10.60.35.42 with SMTP id e10mr24917199oej.26.1439310421577; Tue, 11 Aug 2015 09:27:01 -0700 (PDT) Received: by 10.76.50.84 with HTTP; Tue, 11 Aug 2015 09:27:01 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <201508082359.t78NxGGZ026906@repo.freebsd.org> References: <201508082359.t78NxGGZ026906@repo.freebsd.org> Date: Tue, 11 Aug 2015 18:27:01 +0200 Message-ID: Subject: Re: svn commit: r286490 - head/lib/libc/locale From: Ed Schouten To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 16:27:08 -0000 2015-08-09 1:59 GMT+02:00 Baptiste Daroussin : > Remove 5 and 6 bytes sequences which are illegal in UTF-8 space. > > Per rfc3629 value greater than 0x10ffff should be rejected I think the change you made only ensures that the value cannot exceed 0x1fffff -- not 0x10ffff. You probably need to do something like this: 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 = EILSEQ; return ((size_t)-1); } - if (wch >= 0xd800 && wch <= 0xdfff) { + if ((wch >= 0xd800 && wch <= 0xdfff) || wch > 0x10ffff) { /* * Malformed input; invalid code points. */ -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717