aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-10-27 13:33:26 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-10-27 13:33:26 +0100
commit0062ace2292effc4135c15ea99b1931fea5e0203 (patch)
treee82fad1911341d86bf5646f1f6418d7e80e39fd1 /locale
parent7a4cb4ad1130e43e1256f85cea38a3227320f944 (diff)
downloadglibc-0062ace2292effc4135c15ea99b1931fea5e0203.zip
glibc-0062ace2292effc4135c15ea99b1931fea5e0203.tar.gz
glibc-0062ace2292effc4135c15ea99b1931fea5e0203.tar.bz2
Gracefully handle incompatible locale data
* locale/loadlocale.c (_nl_intern_locale_data): Change assertion on CNT to a conditional jump to 'puntdata'.
Diffstat (limited to 'locale')
-rw-r--r--locale/loadlocale.c7
1 files changed, 4 insertions, 3 deletions
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);