Fix get_mac_addresses() potential buffer over-read
The macOS/BSD implementation of get_mac_addresses() can check the link-layer address length early on to filter out interfaces that don't have a MAC address. e.g. loopback interfaces don't have one. A concern is that the sdl_data array of sockaddr_dl contains both the data for the interface name and link-layer address, but get_mac_addresses() is always assuming enough space was allocated in the array to read 6 bytes of the MAC address even when some interfaces report an address length of 0. e.g. long interface names without a MAC address could be a problem.
Showing
Please register or sign in to comment