Avoid possible crashes in anormal nscd exits

(cherry picked from commit feb1eb0be7)
This commit is contained in:
Ulrich Drepper 2011-07-19 13:59:57 -04:00 committed by Andreas Schwab
parent b3c34b4a97
commit f6244abb8c
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-05 Andreas Jaeger <aj@suse.de>
[BZ#9696]

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