diff options
author | brooks <brooks@FreeBSD.org> | 2005-06-13 23:43:08 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-06-13 23:43:08 +0000 |
commit | d6e60e9b867a54a54b941c4ff2300aefa5b1ab8f (patch) | |
tree | 2eec9d91fe04d7c60dc49058d09d47ab28b80ca2 /sbin/dhclient | |
parent | 2b425cf5e216be9701e947331dbc1227dbdad1d4 (diff) | |
download | FreeBSD-src-d6e60e9b867a54a54b941c4ff2300aefa5b1ab8f.zip FreeBSD-src-d6e60e9b867a54a54b941c4ff2300aefa5b1ab8f.tar.gz |
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 <snow at teardrop dot org>
Approved by: re (dhclient blanket)
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 14a1562..24bf88b 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; } |