From feb1eb0be78b40d53c71474f07d1b0517ba95586 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 19 Jul 2011 13:59:57 -0400 Subject: [PATCH] Avoid possible crashes in anormal nscd exits --- ChangeLog | 5 +++++ nscd/nscd.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3de90108af3..b6cc5ca942f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Ulrich Drepper + + * nscd/nscd.c (termination_handler): Don't do anything for a database + if it has not yet been initialized. + 2011-07-18 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/sched.h (__CPU_EQUAL_S): Fix a typo. diff --git a/nscd/nscd.c b/nscd/nscd.c index 4894cb2faa6..e9bb75d3e94 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. */ -- 2.47.2