]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Also check dead->data[category] != NULL
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 5 Aug 2015 15:15:51 +0000 (08:15 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 5 Aug 2015 15:15:51 +0000 (08:15 -0700)
_nl_load_locale_from_archive (int category, const char **namep)

has

 for (cnt = 0; cnt < __LC_LAST; ++cnt)
    if (cnt != LC_ALL)
      {
        lia->data[cnt] = _nl_intern_locale_data (cnt,
                                                 results[cnt].addr,
                                                 results[cnt].len);
        if (__glibc_likely (lia->data[cnt] != NULL))
          {
...
          }
      }

lia->data[cnt] can be NULL, which happens to en_US.UTF-8 with
LC_COLLATE.  But this won't happen if glibc is configured with
--enable-hardcoded-path-in-tests.  We should also check
dead->data[category] != NULL.

* locale/loadarchive.c (_nl_archive_subfreeres): Also check
dead->data[category] != NULL.

ChangeLog
locale/loadarchive.c

index 8d7a8b4f61bfc8b38d2debe80edc4b7e18aabf90..adeba9268d8ea402ccc36bdbcb58aea141bc94ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * locale/loadarchive.c (_nl_archive_subfreeres): Also check
+       dead->data[category] != NULL.
+
 2015-08-05  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #18647]
index ce5c21036c4adfa015fba180cb8262e269b3103a..3e18cf045b95892108ee9aa2b73ee7e67672328d 100644 (file)
@@ -515,7 +515,7 @@ _nl_archive_subfreeres (void)
 
       free (dead->name);
       for (category = 0; category < __LC_LAST; ++category)
-       if (category != LC_ALL)
+       if (category != LC_ALL && dead->data[category] != NULL)
          {
            /* _nl_unload_locale just does this free for the archive case.  */
            if (dead->data[category]->private.cleanup)