]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix some uninitialized objects.
authorTed Lemon <source@isc.org>
Wed, 15 Sep 1999 19:47:38 +0000 (19:47 +0000)
committerTed Lemon <source@isc.org>
Wed, 15 Sep 1999 19:47:38 +0000 (19:47 +0000)
common/discover.c
common/memory.c
omapip/listener.c
server/confpars.c

index 2c18cb3cbc5c00916f6d146d5332155d14b967e2..38358004c533c187161796369b1304a4e8b382a2 100644 (file)
@@ -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);
index 7f7be341e47af761c6d93fc6dd9db68d82b06bf3..9e035c33c1e9571d84e56df20d6673fd07565575 100644 (file)
@@ -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;
index 6e196ac88bc9f7b5496a8b22197e59f070cf1c86..f415386bba2cfaf9b0cfeb21b7bf6bf93e8d30d4 100644 (file)
@@ -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;
 
index e584d283e59e40bb61a6d6e3240c6f5f12b16745..75b9c635e1533091c07479baae0da9e13cd9c526 100644 (file)
@@ -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");