wext_scan: fix possibly unterminated ifname string
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 29 Oct 2015 09:53:32 +0000 (10:53 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 29 Oct 2015 09:53:32 +0000 (10:53 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
iwinfo_wext_scan.c

index a066721..1d7ec16 100644 (file)
@@ -25,7 +25,7 @@
 
 static int wext_ioctl(const char *ifname, int cmd, struct iwreq *wrq)
 {
-       strncpy(wrq->ifr_name, ifname, IFNAMSIZ);
+       strncpy(wrq->ifr_name, ifname, IFNAMSIZ - 1);
        return iwinfo_ioctl(cmd, wrq);
 }