mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] fix iconv conversions for iso88592-iso885916
Date: Tue, 20 Jun 2017 20:41:42 -0400	[thread overview]
Message-ID: <20170621004142.GA1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <20170615213048.2566-1-b.brachaczek@gmail.com>

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


  reply	other threads:[~2017-06-21  0:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 21:30 Bartosz Brachaczek
2017-06-21  0:41 ` Rich Felker [this message]
2017-06-21  2:22   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170621004142.GA1627@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).