mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
Fixed bug #39956 (netif_create_ip6_linklocal_address out of bounds access of netif::hwaddr)
This commit is contained in:
parent
90a0590de1
commit
12514c09b2
@ -884,14 +884,13 @@ netif_create_ip6_linklocal_address(struct netif * netif, u8_t from_mac_48bit)
|
||||
((u32_t)(netif->hwaddr[3]) << 16) |
|
||||
((u32_t)(netif->hwaddr[4]) << 8) |
|
||||
(netif->hwaddr[5]));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* Use hwaddr directly as interface ID. */
|
||||
netif->ip6_addr[0].addr[2] = 0;
|
||||
netif->ip6_addr[0].addr[3] = 0;
|
||||
|
||||
addr_index = 3;
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (i = 0; (i < 8) && (i < netif->hwaddr_len); i++) {
|
||||
if (i == 4) {
|
||||
addr_index--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user