mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-12 12:45:35 +00:00
Sanity-check the size of netif->hwaddr
This commit is contained in:
parent
b56a1501d2
commit
c69914367d
@ -1693,7 +1693,7 @@ dhcp_create_msg(struct netif *netif, struct dhcp *dhcp, u8_t message_type)
|
||||
ip_addr_set_zero(&dhcp->msg_out->giaddr);
|
||||
for (i = 0; i < DHCP_CHADDR_LEN; i++) {
|
||||
/* copy netif hardware address, pad with zeroes */
|
||||
dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/* pad byte*/;
|
||||
dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len && i < NETIF_MAX_HWADDR_LEN) ? netif->hwaddr[i] : 0/* pad byte*/;
|
||||
}
|
||||
for (i = 0; i < DHCP_SNAME_LEN; i++) {
|
||||
dhcp->msg_out->sname[i] = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user