Avoid possible crashes in anormal nscd exits

This commit is contained in:
Ulrich Drepper 2011-07-19 13:59:57 -04:00
parent 298711ffe4
commit feb1eb0be7
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View 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. */