From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11540 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] fix iconv conversions for iso88592-iso885916 Date: Tue, 20 Jun 2017 20:41:42 -0400 Message-ID: <20170621004142.GA1627@brightrain.aerifal.cx> References: <20170615213048.2566-1-b.brachaczek@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1498005716 20857 195.159.176.226 (21 Jun 2017 00:41:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Jun 2017 00:41:56 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11553-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jun 21 02:41:52 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dNTiR-0005FX-Lc for gllmg-musl@m.gmane.org; Wed, 21 Jun 2017 02:41:51 +0200 Original-Received: (qmail 16181 invoked by uid 550); 21 Jun 2017 00:41:54 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 16163 invoked from network); 21 Jun 2017 00:41:53 -0000 Content-Disposition: inline In-Reply-To: <20170615213048.2566-1-b.brachaczek@gmail.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11540 Archived-At: On Thu, Jun 15, 2017 at 11:30:48PM +0200, Bartosz Brachaczek wrote: > commit 97bd6b09dbe7478d5a90a06ecd9e5b59389d8eb9 refactored the table > lookup into a function and introduced an error in index computation. > the error caused garbage to be read from the table if the given charmap > had a non-zero number of elided entries. > --- > src/locale/iconv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/locale/iconv.c b/src/locale/iconv.c > index 4636307f..fd2f2e01 100644 > --- a/src/locale/iconv.c > +++ b/src/locale/iconv.c > @@ -153,7 +153,7 @@ static void put_32(unsigned char *s, unsigned c, int e) > > static unsigned legacy_map(const unsigned char *map, unsigned c) > { > - unsigned x = c - 128 + map[-1]; > + unsigned x = c - 128 - map[-1]; > x = legacy_chars[ map[x*5/4]>>2*x%8 | > map[x*5/4+1]<<8-2*x%8 & 1023 ]; > return x ? x : c; > -- > 2.13.0 Thanks! Applying. Rich