summaryrefslogtreecommitdiff
path: root/server/mdb.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-10-05 18:44:27 +0000
committerTed Lemon <source@isc.org>1999-10-05 18:44:27 +0000
commit41a7cabfb7b2fef1bb1da708404db1976b39b589 (patch)
tree2ee992f7776b8f77bca55c7e8ec532cc9ad5dc9d /server/mdb.c
parente0bec34702219a25362c18ea749bcb10fd75ec98 (diff)
downloadisc-dhcp-41a7cabfb7b2fef1bb1da708404db1976b39b589.tar.gz
Check for non-null group-name-hash before traversing it.
Diffstat (limited to 'server/mdb.c')
-rw-r--r--server/mdb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/mdb.c b/server/mdb.c
index 9571f2e7..66939362 100644
--- a/server/mdb.c
+++ b/server/mdb.c
@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
-"$Id: mdb.c,v 1.5 1999/10/05 02:47:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: mdb.c,v 1.6 1999/10/05 18:44:27 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -1226,7 +1226,8 @@ void write_leases ()
int i;
/* Write all the dynamically-created group declarations. */
- for (i = 0; i < group_name_hash -> hash_count; i++) {
+ if (group_name_hash) {
+ for (i = 0; i < group_name_hash -> hash_count; i++) {
for (hb = group_name_hash -> buckets [i];
hb; hb = hb -> next) {
gp = (struct group_object *)hb -> value;
@@ -1235,6 +1236,7 @@ void write_leases ()
(gp -> flags & GROUP_OBJECT_DELETED)))
write_group (gp);
}
+ }
}
/* Write all the dynamically-created host declarations. */