Zero struct ifreq data before use in l2_packet_init()

[Bug 300]
This commit is contained in:
Larry Stefani 2009-03-13 17:04:33 +02:00 committed by Jouni Malinen
parent 90ac1f9fc9
commit b7d3a95afc
1 changed files with 1 additions and 0 deletions

View File

@ -115,6 +115,7 @@ struct l2_packet_data * l2_packet_init(
os_free(l2);
return NULL;
}
os_memset(&ifr, 0, sizeof(ifr));
os_strlcpy(ifr.ifr_name, l2->ifname, sizeof(ifr.ifr_name));
if (ioctl(l2->fd, SIOCGIFINDEX, &ifr) < 0) {
perror("ioctl[SIOCGIFINDEX]");