This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] iconv: Avoid writable data and relocations in IBM charsets
- From: Andreas Schwab <schwab at suse dot de>
- To: fweimer at redhat dot com (Florian Weimer)
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 26 Oct 2016 11:22:59 +0200
- Subject: Re: [PATCH] iconv: Avoid writable data and relocations in IBM charsets
- Authentication-results: sourceware.org; auth=none
- References: <20161026091538.A7628439942E0@oldenburg.str.redhat.com>
On Okt 26 2016, fweimer@redhat.com (Florian Weimer) wrote:
> The IBM930, IBM933, IBM935 and IBM939 converters defined lookup
> tables which were not constant. They also contained an
> unnecessary pointer indirection.
>
> 2016-10-26 Florian Weimer <fweimer@redhat.com>
>
> * iconvdata/ibm930.h (__ucs4_to_ibm930sb): Switch from writable
> array of string pointers to constant array of two-character
> arrays.
> * iconvdata/ibm933.h (__ucs4_to_ibm933sb): Likewise.
> * iconvdata/ibm935.h (__ucs4_to_ibm935sb): Likewise.
> * iconvdata/ibm939.h (__ucs4_to_ibm939sb): Likewise.
>
> diff --git a/iconvdata/ibm930.h b/iconvdata/ibm930.h
> index 1afda56..1f2d87d 100644
> --- a/iconvdata/ibm930.h
> +++ b/iconvdata/ibm930.h
> @@ -1499,7 +1499,7 @@ static const struct gap __ucs4_to_ibm930sb_idx[] =
> { .start = 0xffff, .end = 0xffff, .idx = 0 }
> };
>
> -static const char * __ucs4_to_ibm930sb[] =
> +static const char __ucs4_to_ibm930sb[][2] =
I think you can even make that [1].
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."