summaryrefslogtreecommitdiff
path: root/src/monitor
diff options
context:
space:
mode:
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor_netlink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c
index 8455f688..2fe380ac 100644
--- a/src/monitor/monitor_netlink.c
+++ b/src/monitor/monitor_netlink.c
@@ -117,7 +117,8 @@ static bool has_wireless_extension(const char *ifname)
return false;
}
- strncpy(iwr.ifr_ifrn.ifrn_name, ifname, IFNAMSIZ);
+ strncpy(iwr.ifr_ifrn.ifrn_name, ifname, IFNAMSIZ-1);
+ iwr.ifr_ifrn.ifrn_name[IFNAMSIZ-1] = '\0';
/* Does the interface support a wireless extension? */
ret = ioctl(s, SIOCGIWNAME, &iwr);
close(s);