diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-07-19 13:59:57 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-07-19 13:59:57 -0400 |
commit | feb1eb0be78b40d53c71474f07d1b0517ba95586 (patch) | |
tree | 88058a8c9f57d43a1f2f9ab333cef01369731afa | |
parent | 298711ffe475d2401e8037fd89538228e35ee79a (diff) | |
download | glibc-feb1eb0be78b40d53c71474f07d1b0517ba95586.zip glibc-feb1eb0be78b40d53c71474f07d1b0517ba95586.tar.gz glibc-feb1eb0be78b40d53c71474f07d1b0517ba95586.tar.bz2 |
Avoid possible crashes in anormal nscd exits
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | nscd/nscd.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -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. diff --git a/nscd/nscd.c b/nscd/nscd.c index 4894cb2..e9bb75d 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -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. */ |