2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-30 13:57:50 +00:00

Make sure there's a host hanging off the lease before dereferencing it

This commit is contained in:
Ted Lemon
1996-05-22 09:51:26 +00:00
parent c1503c57db
commit acf6cfe389
2 changed files with 4 additions and 4 deletions

4
dhcp.c
View File

@@ -429,7 +429,7 @@ void ack_lease (packet, lease, offer, when)
/* Choose a filename; first from the host_decl, if any, then from /* Choose a filename; first from the host_decl, if any, then from
the user class, then from the vendor class. */ the user class, then from the vendor class. */
if (lease -> host -> filename) if (lease -> host && lease -> host -> filename)
filename = lease -> host -> filename; filename = lease -> host -> filename;
else if (user_class && user_class -> filename) else if (user_class && user_class -> filename)
filename = user_class -> filename; filename = user_class -> filename;
@@ -438,7 +438,7 @@ void ack_lease (packet, lease, offer, when)
else filename = (char *)0; else filename = (char *)0;
/* Choose a server name as above. */ /* Choose a server name as above. */
if (lease -> host -> server_name) if (lease -> host && lease -> host -> server_name)
server_name = lease -> host -> server_name; server_name = lease -> host -> server_name;
else if (user_class && user_class -> server_name) else if (user_class && user_class -> server_name)
server_name = user_class -> server_name; server_name = user_class -> server_name;

View File

@@ -429,7 +429,7 @@ void ack_lease (packet, lease, offer, when)
/* Choose a filename; first from the host_decl, if any, then from /* Choose a filename; first from the host_decl, if any, then from
the user class, then from the vendor class. */ the user class, then from the vendor class. */
if (lease -> host -> filename) if (lease -> host && lease -> host -> filename)
filename = lease -> host -> filename; filename = lease -> host -> filename;
else if (user_class && user_class -> filename) else if (user_class && user_class -> filename)
filename = user_class -> filename; filename = user_class -> filename;
@@ -438,7 +438,7 @@ void ack_lease (packet, lease, offer, when)
else filename = (char *)0; else filename = (char *)0;
/* Choose a server name as above. */ /* Choose a server name as above. */
if (lease -> host -> server_name) if (lease -> host && lease -> host -> server_name)
server_name = lease -> host -> server_name; server_name = lease -> host -> server_name;
else if (user_class && user_class -> server_name) else if (user_class && user_class -> server_name)
server_name = user_class -> server_name; server_name = user_class -> server_name;