]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
udp: udp_get_ifaddr() - coverity fix for ifr_name
authorJaroslav Kysela <perex@perex.cz>
Tue, 4 Apr 2017 14:03:49 +0000 (16:03 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 4 Apr 2017 14:03:49 +0000 (16:03 +0200)
src/udp.c

index 04edac326f8a9e22ce454d0509a62d04b0ae11ee..20adf3747ceb79eefab812f8b31e1079f5c46cd4 100644 (file)
--- a/src/udp.c
+++ b/src/udp.c
@@ -128,7 +128,7 @@ udp_get_ifaddr( int fd, const char *ifname, struct in_addr *addr )
     return -1;
   
   memset(&ifreq, 0, sizeof(ifreq));
-  strncpy(ifreq.ifr_name, ifname, IFNAMSIZ);
+  strncpy(ifreq.ifr_name, ifname, IFNAMSIZ-1);
   
   if (ioctl(fd, SIOCGIFADDR, &ifreq) < 0)
     return -1;