From 59eac186e2cd0aea1bb41a9c3c16f5e76c55c62a Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Mon, 13 Jun 2005 23:43:08 +0000 Subject: [PATCH] Avoid a null pointer dereference by not expiring our lease if we don't have an active one. Submitted by: sam Reported by: James Snow Approved by: re (dhclient blanket) --- sbin/dhclient/dhclient.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 14a156287d9b..24bf88bdf4ac 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -257,12 +257,15 @@ routehandler(struct protocol *p) * state and then wait for either a link down * notification or an associate event. */ - script_init("EXPIRE", NULL); - script_write_params("old_", ifi->client->active); - if (ifi->client->alias) - script_write_params("alias_", - ifi->client->alias); - script_go(); + if (ifi->client->active != NULL) { + script_init("EXPIRE", NULL); + script_write_params("old_", + ifi->client->active); + if (ifi->client->alias) + script_write_params("alias_", + ifi->client->alias); + script_go(); + } ifi->client->state = S_INIT; break; }