diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-08-11 18:41:14 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-08-11 18:41:14 +0000 |
commit | 18e4b727f5e650c651e54719e193c7fcb20fd843 (patch) | |
tree | 7f8284e80c537423d9059a755353f94b02415efa /sbin | |
parent | 68f5f9f555457778d03839d09f5d062420d3320b (diff) |
When parsing 32 bit values, verify that we received 4 bytes.
ok krw@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 7562a3e23a7..eca0134e8f6 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.318 2014/07/13 14:50:03 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.319 2014/08/11 18:41:13 tobias Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -2512,17 +2512,17 @@ set_lease_times(struct client_lease *lease) * Take the server-provided times if available. Otherwise * figure them out according to the spec. */ - if (lease->options[DHO_DHCP_LEASE_TIME].data) + if (lease->options[DHO_DHCP_LEASE_TIME].len == 4) lease->expiry = getULong(lease->options[DHO_DHCP_LEASE_TIME].data); else lease->expiry = DEFAULT_LEASE_TIME; - if (lease->options[DHO_DHCP_RENEWAL_TIME].len) + if (lease->options[DHO_DHCP_RENEWAL_TIME].len == 4) lease->renewal = getULong(lease->options[DHO_DHCP_RENEWAL_TIME].data); else lease->renewal = lease->expiry / 2; - if (lease->options[DHO_DHCP_REBINDING_TIME].len) + if (lease->options[DHO_DHCP_REBINDING_TIME].len == 4) lease->rebind = getULong(lease->options[DHO_DHCP_REBINDING_TIME].data); else |