From 74aed808a1bcb1363cbc2c48ee89e39e90c041d1 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Fri, 29 Nov 2019 03:31:47 +0000 Subject: [PATCH] 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 Submitted by: Young MFC after: I don't plan to but you should feel free Security: yes --- sbin/dhclient/dhclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;