mirror of git://sourceware.org/git/glibc.git
tst-if_nameindex.c: Fix minimum buffer size
The standard says that the buffer given to if_indextoname shall have at least IF_NAMESIZE bytes.
This commit is contained in:
parent
f05ab7c4a9
commit
274441f62a
|
|
@ -72,6 +72,8 @@ do_test (void)
|
||||||
if (strlen (ifp->if_name) + 1 > buflen)
|
if (strlen (ifp->if_name) + 1 > buflen)
|
||||||
buflen = strlen (ifp->if_name) + 1;
|
buflen = strlen (ifp->if_name) + 1;
|
||||||
}
|
}
|
||||||
|
if (buflen < IF_NAMESIZE)
|
||||||
|
buflen = IF_NAMESIZE;
|
||||||
buffer = (char *) xmalloc (buflen);
|
buffer = (char *) xmalloc (buflen);
|
||||||
|
|
||||||
/* Check normal operation. */
|
/* Check normal operation. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue