]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Gracefully handle incompatible locale data
authorLudovic Courtès <ludo@gnu.org>
Tue, 27 Oct 2015 12:33:26 +0000 (13:33 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 27 Oct 2015 12:33:26 +0000 (13:33 +0100)
* locale/loadlocale.c (_nl_intern_locale_data): Change assertion
on CNT to a conditional jump to 'puntdata'.

ChangeLog
locale/loadlocale.c

index 4ce7a9227c7e7bdc5fb629de4c98dfa0e6baac23..29ec9125a2f5f8e1944936efc0db337dea38bd01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-27  Ludovic Courtès  <ludo@gnu.org>
+
+       * locale/loadlocale.c (_nl_intern_locale_data): Change assertion
+       on CNT to a conditional jump to 'puntdata'.
+
 2015-10-27  Joseph Myers  <joseph@codesourcery.com>
 
        * configure.ac (libc_cv_gcc___thread): Remove configure test.
index fdba6e93c4cd3e400062f57f31b1633df78902c9..dcbb833a16d7845059816cd17ff132d928feca04 100644 (file)
@@ -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);