mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-24 07:06:39 +00:00
fix sprintf overflow
This commit is contained in:
parent
e8390afad5
commit
d526dca1bb
2
one.cpp
2
one.cpp
@ -1333,7 +1333,7 @@ static int cli(int argc,char **argv)
|
|||||||
if (ioctl(sock, SIOCGIFHWADDR, &ifr) == 0) {
|
if (ioctl(sock, SIOCGIFHWADDR, &ifr) == 0) {
|
||||||
unsigned char mac_addr[6];
|
unsigned char mac_addr[6];
|
||||||
memcpy(mac_addr, ifr.ifr_hwaddr.sa_data, 6);
|
memcpy(mac_addr, ifr.ifr_hwaddr.sa_data, 6);
|
||||||
char macStr[16];
|
char macStr[18];
|
||||||
sprintf(macStr, "%02x:%02x:%02x:%02x:%02x:%02x",
|
sprintf(macStr, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||||
mac_addr[0],
|
mac_addr[0],
|
||||||
mac_addr[1],
|
mac_addr[1],
|
||||||
|
Loading…
Reference in New Issue
Block a user