From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88951 invoked by alias); 26 Oct 2016 09:15:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 88940 invoked by uid 89); 26 Oct 2016 09:15:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=x2f, x0d, x10, 2016-10-26 X-HELO: mx1.redhat.com Date: Wed, 26 Oct 2016 09:15:00 -0000 To: libc-alpha@sourceware.org Subject: [PATCH] iconv: Avoid writable data and relocations in IBM charsets User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20161026091538.A7628439942E0@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-SW-Source: 2016-10/txt/msg00446.txt.bz2 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 * 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] = { "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16", "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11", diff --git a/iconvdata/ibm933.h b/iconvdata/ibm933.h index cb00137..4b9317a 100644 --- a/iconvdata/ibm933.h +++ b/iconvdata/ibm933.h @@ -3371,7 +3371,7 @@ static const struct gap __ucs4_to_ibm933sb_idx[] = { .start = 0xffff, .end = 0xffff, .idx = 0 } }; -static const char *__ucs4_to_ibm933sb[] = +static const char __ucs4_to_ibm933sb[][2] = { "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16", "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11", diff --git a/iconvdata/ibm935.h b/iconvdata/ibm935.h index f7a96e9..b178f59 100644 --- a/iconvdata/ibm935.h +++ b/iconvdata/ibm935.h @@ -1282,7 +1282,7 @@ static const struct gap __ucs4_to_ibm935sb_idx[] = { .start = 0xffff, .end = 0xffff, .idx = 0 } }; -static const char *__ucs4_to_ibm935sb[] = +static const char __ucs4_to_ibm935sb[][2] = { "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16", "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11", diff --git a/iconvdata/ibm939.h b/iconvdata/ibm939.h index bb8a8de..a9d8bf8 100644 --- a/iconvdata/ibm939.h +++ b/iconvdata/ibm939.h @@ -1499,7 +1499,7 @@ static const struct gap __ucs4_to_ibm939sb_idx[] = { .start = 0xffff, .end = 0xffff, .idx = 0 } }; -static const char * __ucs4_to_ibm939sb[] = +static const char __ucs4_to_ibm939sb[][2] = { "\x00", "\x01", "\x02", "\x03", "\x37", "\x2d", "\x2e", "\x2f", "\x16", "\x05", "\x25", "\x0b", "\x0c", "\x0d", "\x3f", "\x3f", "\x10", "\x11",