From acf6cfe3892ab6bef7a18f357de89d8d6e2a6411 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Wed, 22 May 1996 09:51:26 +0000 Subject: [PATCH] Make sure there's a host hanging off the lease before dereferencing it --- dhcp.c | 4 ++-- server/dhcp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dhcp.c b/dhcp.c index 69dc857c..cca056e2 100644 --- a/dhcp.c +++ b/dhcp.c @@ -429,7 +429,7 @@ void ack_lease (packet, lease, offer, when) /* Choose a filename; first from the host_decl, if any, then from the user class, then from the vendor class. */ - if (lease -> host -> filename) + if (lease -> host && lease -> host -> filename) filename = lease -> host -> filename; else if (user_class && user_class -> filename) filename = user_class -> filename; @@ -438,7 +438,7 @@ void ack_lease (packet, lease, offer, when) else filename = (char *)0; /* Choose a server name as above. */ - if (lease -> host -> server_name) + if (lease -> host && lease -> host -> server_name) server_name = lease -> host -> server_name; else if (user_class && user_class -> server_name) server_name = user_class -> server_name; diff --git a/server/dhcp.c b/server/dhcp.c index 69dc857c..cca056e2 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -429,7 +429,7 @@ void ack_lease (packet, lease, offer, when) /* Choose a filename; first from the host_decl, if any, then from the user class, then from the vendor class. */ - if (lease -> host -> filename) + if (lease -> host && lease -> host -> filename) filename = lease -> host -> filename; else if (user_class && user_class -> filename) filename = user_class -> filename; @@ -438,7 +438,7 @@ void ack_lease (packet, lease, offer, when) else filename = (char *)0; /* Choose a server name as above. */ - if (lease -> host -> server_name) + if (lease -> host && lease -> host -> server_name) server_name = lease -> host -> server_name; else if (user_class && user_class -> server_name) server_name = user_class -> server_name;