fix: PICAN openDevice buffer overflow in ifr_name
This commit is contained in:
@@ -73,7 +73,8 @@ bool PICAN::openDevice() {
|
||||
}
|
||||
fcntl(sock, F_SETFL, fcntl(sock, F_GETFL) | O_NONBLOCK);
|
||||
ifreq ifr;
|
||||
strcpy(ifr.ifr_name, path().dataAscii());
|
||||
piZeroMemory(ifr);
|
||||
strncpy(ifr.ifr_name, path().dataAscii(), sizeof(ifr.ifr_name));
|
||||
piCout << "PICAN try to get interface index...";
|
||||
if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) {
|
||||
piCoutObj << "Error! while determin the interface ioctl";
|
||||
|
||||
Reference in New Issue
Block a user