From: Ted Lemon Date: Wed, 15 Sep 1999 19:47:38 +0000 (+0000) Subject: Fix some uninitialized objects. X-Git-Tag: V3-BETA-1-PATCH-2~5^2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d92095d6e972bcc058f9c895ea0b49406300c80;p=thirdparty%2Fdhcp.git Fix some uninitialized objects. --- diff --git a/common/discover.c b/common/discover.c index 2c18cb3cb..38358004c 100644 --- a/common/discover.c +++ b/common/discover.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: discover.c,v 1.13 1999/09/09 23:26:11 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: discover.c,v 1.14 1999/09/15 19:47:27 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -149,6 +149,7 @@ void discover_interfaces (state) if (!tmp) log_fatal ("Insufficient memory to %s %s", "record interface", ifp -> ifr_name); + memset (tmp, 0, sizeof *tmp); strcpy (tmp -> name, ifp -> ifr_name); tmp -> circuit_id = (u_int8_t *)tmp -> name; tmp -> circuit_id_len = strlen (tmp -> name); diff --git a/common/memory.c b/common/memory.c index 7f7be341e..9e035c33c 100644 --- a/common/memory.c +++ b/common/memory.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: memory.c,v 1.56 1999/09/09 23:26:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: memory.c,v 1.57 1999/09/15 19:47:27 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -458,7 +458,8 @@ void new_address_range (low, high, subnet, pool) if (!address_range) { strcpy (lowbuf, piaddr (low)); strcpy (highbuf, piaddr (high)); - log_fatal ("No memory for address range %s-%s.", lowbuf, highbuf); + log_fatal ("No memory for address range %s-%s.", + lowbuf, highbuf); } memset (address_range, 0, (sizeof *address_range) * (max - min + 1)); @@ -635,6 +636,7 @@ void enter_lease (lease) log_fatal ("No memory for lease %s\n", piaddr (lease -> ip_addr)); } + memset (comp, 0, sizeof *comp); *comp = *lease; comp -> next = dangling_leases; comp -> prev = (struct lease *)0; diff --git a/omapip/listener.c b/omapip/listener.c index 6e196ac88..f415386bb 100644 --- a/omapip/listener.c +++ b/omapip/listener.c @@ -130,6 +130,7 @@ isc_result_t omapi_accept (omapi_object_t *h) obj = (omapi_connection_object_t *)malloc (sizeof *obj); if (!obj) return ISC_R_NOMEMORY; + memset (obj, 0, sizeof *obj); obj -> refcnt = 1; obj -> type = omapi_type_connection; diff --git a/server/confpars.c b/server/confpars.c index e584d283e..75b9c635e 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.79 1999/09/09 23:32:22 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.80 1999/09/15 19:47:38 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -915,7 +915,7 @@ void parse_host_declaration (cfile, group) "parse_host_declaration"); if (!host) log_fatal ("can't allocate host decl struct %s.", name); - + memset (host, 0, sizeof *host); host -> name = name; host -> group = clone_group (group, "parse_host_declaration");