From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: i18n/l10n summary Date: Sat, 2 Dec 2017 21:43:28 -0800 Organization: UCLA Computer Science Department Message-ID: <3c0ffa49-bf6d-1747-b9da-97e3a842e36c@cs.ucla.edu> References: <3931675f-e26c-2f14-b229-61f518816fff@cs.ucla.edu> <0aec575b-6cbe-bc87-2d54-7de95be5c080@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8F72BFD0A72631B3244AA37F" X-Trace: blaine.gmane.org 1512279860 28566 195.159.176.226 (3 Dec 2017 05:44:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 3 Dec 2017 05:44:20 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: Philipp Stephani , Jean-Christophe Helary , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 03 06:44:15 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eLN4Y-0007A5-N9 for ged-emacs-devel@m.gmane.org; Sun, 03 Dec 2017 06:44:14 +0100 Original-Received: from localhost ([::1]:37952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLN4g-0004X2-2T for ged-emacs-devel@m.gmane.org; Sun, 03 Dec 2017 00:44:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLN40-0004Ww-Gl for emacs-devel@gnu.org; Sun, 03 Dec 2017 00:43:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLN3v-00052Y-Hw for emacs-devel@gnu.org; Sun, 03 Dec 2017 00:43:40 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41696) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eLN3v-00051S-8b for emacs-devel@gnu.org; Sun, 03 Dec 2017 00:43:35 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 204C416124B; Sat, 2 Dec 2017 21:43:33 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 2RlazEiECtwH; Sat, 2 Dec 2017 21:43:32 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4979B16124D; Sat, 2 Dec 2017 21:43:32 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aSGfU31vx8y3; Sat, 2 Dec 2017 21:43:32 -0800 (PST) Original-Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1B7491611E2; Sat, 2 Dec 2017 21:43:32 -0800 (PST) In-Reply-To: <0aec575b-6cbe-bc87-2d54-7de95be5c080@cs.ucla.edu> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220645 Archived-At: This is a multi-part message in MIME format. --------------8F72BFD0A72631B3244AA37F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable I wrote on 2017-06-04: > Philipp Stephani wrote: >> It's not hard to fix, >=20 > Thanks. However, on my platform those fixes slowed down a microbenchmar= k (format=20 > "%d %s %c" 3 "def" ?=E2=80=98) by 7%, so I installed the attached furth= er patch, which=20 > recovered the performance loss for me. Oops, that introduced an off-by-one error that caused Emacs to access one= past=20 the end of the 'info' array. To fix this I installed the attached further= patch=20 into emacs-26 and merged emacs-26 into master. --------------8F72BFD0A72631B3244AA37F Content-Type: text/x-patch; name="0001-Fix-bug-in-i18n-l10n-optimization.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Fix-bug-in-i18n-l10n-optimization.patch" =46rom 04e5b28ff1691345e023a944dc6a6a9e9573bd07 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Dec 2017 21:31:24 -0800 Subject: [PATCH] Fix bug in i18n/l10n optimization This fixes a off-by-one buffer overrun bug introduced in 2017-06-04T15:39:37Z!eggert@cs.ucla.edu. Problem uncovered by an experimental version of Emacs built with -fcheck-pointer-bounds and running on Intel MPX hardware. * src/editfns.c (styled_format): Avoid overrunning internal buffers. --- src/editfns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index f275f33..f7c26b9 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4919,7 +4919,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message) else if (discarded[bytepos] =3D=3D 1) { position++; - if (translated =3D=3D info[fieldn].start) + if (fieldn < nspec && translated =3D=3D info[fieldn].start) { translated +=3D info[fieldn].end - info[fieldn].start; fieldn++; @@ -4939,7 +4939,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, = bool message) else if (discarded[bytepos] =3D=3D 1) { position++; - if (translated =3D=3D info[fieldn].start) + if (fieldn < nspec && translated =3D=3D info[fieldn].start) { translated +=3D info[fieldn].end - info[fieldn].start; fieldn++; --=20 2.7.4 --------------8F72BFD0A72631B3244AA37F--