From 0062ace2292effc4135c15ea99b1931fea5e0203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 27 Oct 2015 13:33:26 +0100 Subject: Gracefully handle incompatible locale data * locale/loadlocale.c (_nl_intern_locale_data): Change assertion on CNT to a conditional jump to 'puntdata'. --- locale/loadlocale.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'locale') diff --git a/locale/loadlocale.c b/locale/loadlocale.c index fdba6e9..dcbb833 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -121,9 +121,10 @@ _nl_intern_locale_data (int category, const void *data, size_t datasize) switch (category) { #define CATTEST(cat) \ - case LC_##cat: \ - assert (cnt < (sizeof (_nl_value_type_LC_##cat) \ - / sizeof (_nl_value_type_LC_##cat[0]))); \ + case LC_##cat: \ + if (cnt >= (sizeof (_nl_value_type_LC_##cat) \ + / sizeof (_nl_value_type_LC_##cat[0]))) \ + goto puntdata; \ break CATTEST (NUMERIC); CATTEST (TIME); -- cgit v1.1