Merge pull request #1354 from contrun/fix-sprintf-overflow

fix sprintf overflow
This commit is contained in:
joseph-henry 2021-03-08 17:07:54 -08:00 committed by GitHub
commit 88a1170966
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1333,7 +1333,7 @@ static int cli(int argc,char **argv)
if (ioctl(sock, SIOCGIFHWADDR, &ifr) == 0) {
unsigned char mac_addr[6];
memcpy(mac_addr, ifr.ifr_hwaddr.sa_data, 6);
char macStr[16];
char macStr[18];
sprintf(macStr, "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addr[0],
mac_addr[1],