]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Test a potentially null pointer for nullness before dereferencing it.
authorTed Lemon <source@isc.org>
Fri, 19 Feb 1999 17:59:56 +0000 (17:59 +0000)
committerTed Lemon <source@isc.org>
Fri, 19 Feb 1999 17:59:56 +0000 (17:59 +0000)
server/dhcp.c

index f768cb8c40f181d7107829da31abbae15323036f..80ddc4bcae33400e9a61ed397590839555a0b95a 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.57.2.16 1999/02/16 19:18:35 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.57.2.17 1999/02/19 17:59:56 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1360,7 +1360,8 @@ struct lease *find_lease (packet, share, ours)
           lease to be abandoned.   If so, this request probably came from
           that client. */
        if (ip_lease && (ip_lease -> shared_network != share)) {
-               *ours = 1;
+               if (ours)
+                       *ours = 1;
                ip_lease = (struct lease *)0;
                strcpy (dhcp_message, "requested address on bad subnet");
        }
@@ -1390,7 +1391,8 @@ struct lease *find_lease (packet, share, ours)
                }
                strcpy (dhcp_message, "requested address is not available");
                ip_lease = (struct lease *)0;
-               *ours = 1;
+               if (ours)
+                       *ours = 1;
 
                /* If we get to here and fixed_lease is not null, that means
                   that there are both a dynamic lease and a fixed-address