]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Avoid possible crashes in anormal nscd exits
authorUlrich Drepper <drepper@gmail.com>
Tue, 19 Jul 2011 17:59:57 +0000 (13:59 -0400)
committerAndreas Schwab <schwab@redhat.com>
Thu, 21 Jul 2011 10:21:26 +0000 (12:21 +0200)
(cherry picked from commit feb1eb0be78b40d53c71474f07d1b0517ba95586)

ChangeLog
nscd/nscd.c

index 22f63b168cea6860774087996a4c4e01099c5217..d774296226669e4d52b4a5e7f260c6de94150f45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-19  Ulrich Drepper  <drepper@gmail.com>
+
+       * nscd/nscd.c (termination_handler): Don't do anything for a database
+       if it has not yet been initialized.
+
 2011-07-05  Andreas Jaeger  <aj@suse.de>
 
        [BZ#9696]
index c3d9fe6cef7f37234e57bdbf532e5dbd26af7cd2..f50e81423f4f27ce06f818f566a006480e2ab8b2 100644 (file)
@@ -477,7 +477,7 @@ termination_handler (int signum)
   /* Synchronize memory.  */
   for (int cnt = 0; cnt < lastdb; ++cnt)
     {
-      if (!dbs[cnt].enabled)
+      if (!dbs[cnt].enabled || dbs[cnt].head == NULL)
        continue;
 
       /* Make sure nobody keeps using the database.  */