diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2019-11-29 03:31:47 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2019-11-29 03:31:47 +0000 |
commit | 74aed808a1bcb1363cbc2c48ee89e39e90c041d1 (patch) | |
tree | 1d8b99cab39bd096dfbd03d6aefe55dfe716c4e4 /sbin/dhclient | |
parent | 6d6a03d7a8a617de7fbcb41c4001935563c1e1f7 (diff) | |
download | src-74aed808a1bcb1363cbc2c48ee89e39e90c041d1.tar.gz src-74aed808a1bcb1363cbc2c48ee89e39e90c041d1.zip |
Fix braino in previous bugfix r300174
The previous revision missed the exact same error in a copy paste block
of the same code in another function. Fix the identical case, too.
A DHCP client identifier is simply the hardware type (one byte)
concatenated with the hardware address (some variable number of bytes,
but at most 16). Limit the size of the temporary buffer to match and
the rest of the calculations shake out correctly.
PR: 238022
Reported by: Young <yangx92 AT hotmail.com>
Submitted by: Young <yangx92 AT hotmail.com>
MFC after: I don't plan to but you should feel free
Security: yes
Notes
Notes:
svn path=/head/; revision=355204
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 362cd6cb4c11..8c2615e4c3dc 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1782,7 +1782,7 @@ make_request(struct interface_info *ip, struct client_lease * lease) } /* set unique client identifier */ - char client_ident[sizeof(struct hardware)]; + char client_ident[sizeof(ip->hw_address.haddr) + 1]; if (!options[DHO_DHCP_CLIENT_IDENTIFIER]) { int hwlen = (ip->hw_address.hlen < sizeof(client_ident)-1) ? ip->hw_address.hlen : sizeof(client_ident)-1; |