From patchwork Mon Mar 21 09:10:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafal Luzynski X-Patchwork-Id: 11419 Received: (qmail 62843 invoked by alias); 21 Mar 2016 09:10:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 62798 invoked by uid 89); 21 Mar 2016 09:10:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.5 required=5.0 tests=BAYES_40, KAM_LAZY_DOMAIN_SECURITY, XPRIO autolearn=no version=3.3.2 spammy=H*MI:poczta, H*M:xchange, 457, HImportance:Medium X-HELO: aev204.rev.netart.pl Date: Mon, 21 Mar 2016 10:10:46 +0100 (CET) From: Rafal Luzynski Reply-To: Rafal Luzynski To: libc-alpha@sourceware.org Message-ID: <1568558805.102551.9ea90152-1d54-4eec-8ffa-81bfd328d92b.open-xchange@poczta.nazwa.pl> Subject: [PATCH][BZ 19084] Make sure _nl_value_type_LC_ arrays have correct size. MIME-Version: 1.0 X-Originating-Client: com.openexchange.ox.gui.dhtml Otherwise if the last element of a category is an array (stringarray, wstringarray etc.) this array will count only the first element of the array element and will not load a category, will complain that a locale file is too long. Probably related with bug 19084. --- ChangeLog | 4 ++++ locale/loadlocale.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ad37067..cf201a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-03-19 Rafal Luzynski + * locale/loadlocale.c: Make sure _nl_value_type_LC_ + arrays have correct size. Probably related with bug 19084. + 2016-03-17 Joseph Myers * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_EVENTFD2): diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 2b589ee..2f2025c 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -45,7 +45,8 @@ static const size_t _nl_category_num_items[] = #define NO_PAREN(arg, rest...) arg, ##rest #define DEFINE_CATEGORY(category, category_name, items, a) \ -static const enum value_type _nl_value_type_##category[] = { NO_PAREN items }; +static const enum value_type _nl_value_type_##category \ + [_NL_ITEM_INDEX (_NL_NUM_##category)] = { NO_PAREN items }; #define DEFINE_ELEMENT(element, element_name, optstd, type, rest...) \ [_NL_ITEM_INDEX (element)] = type, #include "categories.def"