diff options
author | Ted Lemon <source@isc.org> | 1999-02-19 17:59:56 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1999-02-19 17:59:56 +0000 |
commit | dd8cf4bac782f441b62263932b705c8dfb8c0cfa (patch) | |
tree | 717079bc216eb6d1398b87f2e30e063bd1cbdffe | |
parent | e0ec739db35424099983a41d90af0091ab708b29 (diff) | |
download | isc-dhcp-dd8cf4bac782f441b62263932b705c8dfb8c0cfa.tar.gz |
Test a potentially null pointer for nullness before dereferencing it.
-rw-r--r-- | server/dhcp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/dhcp.c b/server/dhcp.c index f768cb8c..80ddc4bc 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -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 |