mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 19:00:07 +00:00
hurd: Fix missing trailing NUL in __if_nametoindex
* sysdeps/mach/hurd/if_index.c (__if_nametoindex): Pass the whole buffer size to strncpy.
This commit is contained in:
parent
92846492dc
commit
cd104f4ff4
@ -43,7 +43,7 @@ __if_nametoindex (const char *ifname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
strncpy (ifr.ifr_name, ifname, IFNAMESIZ - 1);
|
||||
strncpy (ifr.ifr_name, ifname, IFNAMESIZ);
|
||||
if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
|
Loading…
Reference in New Issue
Block a user