Browse Source

wext_scan: fix possibly unterminated ifname string

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich 8 years ago
parent
commit
1e628bb535
1 changed files with 1 additions and 1 deletions
  1. 1 1
      iwinfo_wext_scan.c

+ 1 - 1
iwinfo_wext_scan.c

@@ -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);
 }