From 0dc57f52ff74b6efe19650e0bd1c8863ed00c3a1 Mon Sep 17 00:00:00 2001 From: perry Date: Thu, 16 Jan 1997 22:27:01 +0000 Subject: [PATCH] fix coredump per pr-3084 --- usr.sbin/dhcpd/confpars.c | 4 +++- usr.sbin/dhcpd/memory.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.sbin/dhcpd/confpars.c b/usr.sbin/dhcpd/confpars.c index 8c307d042471..412e75db3140 100644 --- a/usr.sbin/dhcpd/confpars.c +++ b/usr.sbin/dhcpd/confpars.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.1.1.1 1996/10/03 06:33:24 mrg Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.2 1997/01/16 22:27:01 perry Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -957,6 +957,8 @@ struct tree *parse_ip_addr_or_hostname (cfile, uniform) if (!name) return (struct tree *)0; rv = tree_host_lookup (name); + if (!rv) + return (struct tree *)0; if (!uniform) rv = tree_limit (rv, 4); } else if (token == NUMBER) { diff --git a/usr.sbin/dhcpd/memory.c b/usr.sbin/dhcpd/memory.c index c6dee2deab65..fc2b9a12cd2c 100644 --- a/usr.sbin/dhcpd/memory.c +++ b/usr.sbin/dhcpd/memory.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: memory.c,v 1.1.1.1 1996/10/03 06:33:25 mrg Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: memory.c,v 1.2 1997/01/16 22:27:03 perry Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -338,6 +338,9 @@ struct subnet *find_grouped_subnet (share, addr) { struct subnet *rv; + if (!share) + return (struct subnet *)0; + for (rv = share -> subnets; rv; rv = rv -> next_sibling) { if (addr_eq (subnet_number (addr, rv -> netmask), rv -> net)) return rv;