not validated against ioctl return value
Opened this issue · 0 comments
devendranaga commented
this could result in a potential uninitalized memory access down the line.
Line 289 in 47afb19
The code below ioctl
is :
sprintf((char*)mac_addr, "%02x%02x%02x%02x%02x%02x",
(int)(unsigned char)ifr.ifr_hwaddr.sa_data[0],
(int)(unsigned char)ifr.ifr_hwaddr.sa_data[1],
(int)(unsigned char)ifr.ifr_hwaddr.sa_data[2],
(int)(unsigned char)ifr.ifr_hwaddr.sa_data[3],
(int)(unsigned char)ifr.ifr_hwaddr.sa_data[4],
(int)(unsigned char)ifr.ifr_hwaddr.sa_data[5]);
And the get_mac_address
OS specific code could be refactored into small functions as well.