You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-wireless/airtraf/files/airtraf-1.1-off-by-one.patch

30 lines
744 B

--- a/src/sniffd/autoconfig.c
+++ b/src/sniffd/autoconfig.c
@@ -68,7 +68,7 @@
struct ifreq ifr;
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- ifr.ifr_name[IFNAMSIZ] = '\0';
+ ifr.ifr_name[IFNAMSIZ -1] = '\0';
if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0){
return (-1);
}
@@ -89,7 +89,7 @@
struct ifreq ifr;
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- ifr.ifr_name[IFNAMSIZ] = '\0';
+ ifr.ifr_name[IFNAMSIZ -1] = '\0';
if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0){
return (-1);
}
@@ -129,7 +129,7 @@
{
/* Set device name */
strncpy(pwrq->ifr_name, ifname, IFNAMSIZ);
- pwrq->ifr_name[IFNAMSIZ] = '\0';
+ pwrq->ifr_name[IFNAMSIZ -1] = '\0';
/* Do the request */
return(ioctl(skfd, request, pwrq));