]> 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)
committerUlrich Drepper <drepper@gmail.com>
Tue, 19 Jul 2011 17:59:57 +0000 (13:59 -0400)
ChangeLog
nscd/nscd.c

index 3de90108af35782daa83234985b2dcba4916dc52..b6cc5ca942f5714974e3acc23c9a7b2ccc110eac 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-18  Ulrich Drepper  <drepper@gmail.com>
 
        * sysdeps/unix/sysv/linux/bits/sched.h (__CPU_EQUAL_S): Fix a typo.
index 4894cb2faa6d6d58ca6aa6ba4b28288a3efe5178..e9bb75d3e941ab49f22644f6f7a5fb1f2cafdb5a 100644 (file)
@@ -493,7 +493,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.  */