This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.18-480-g18d1425


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  18d1425127e5712dda888bb280d5d1a038a45c7f (commit)
      from  520d437b9455560d099fe6bd9664be1f9f76868b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=18d1425127e5712dda888bb280d5d1a038a45c7f

commit 18d1425127e5712dda888bb280d5d1a038a45c7f
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Dec 3 11:16:16 2013 +0100

    locale: don't crash if locale-archive contains all zeros
    
    In case of power failure followed by filesystem issues locale-archive
    can end-up containing all zeros. In that case all calls to setlocale()
    generate a SIGFPE. This renders a system with a default non-C locale
    unbootable.
    
    Avoid this by ignoring the locale instead of generating a SIGFPE.

diff --git a/ChangeLog b/ChangeLog
index 182051a..aec3cb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* locale/loadarchive.c (_nl_load_locale_from_archive): Avoid
+	division by 0.
+
 2013-12-03  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	[BZ #16195]
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index 70136dc..f723780 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -274,6 +274,10 @@ _nl_load_locale_from_archive (int category, const char **namep)
   namehashtab = (struct namehashent *) ((char *) head
 					+ head->namehash_offset);
 
+  /* Avoid division by 0 if the file is corrupted.  */
+  if (__glibc_unlikely (head->namehash_size == 0))
+    goto close_and_out;
+
   idx = hval % head->namehash_size;
   incr = 1 + hval % (head->namehash_size - 2);
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |    5 +++++
 locale/loadarchive.c |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]