diff --git a/inet/tst-if_nameindex.c b/inet/tst-if_nameindex.c index c14fc64b92..a371dc4fc1 100644 --- a/inet/tst-if_nameindex.c +++ b/inet/tst-if_nameindex.c @@ -72,6 +72,8 @@ do_test (void) if (strlen (ifp->if_name) + 1 > buflen) buflen = strlen (ifp->if_name) + 1; } + if (buflen < IF_NAMESIZE) + buflen = IF_NAMESIZE; buffer = (char *) xmalloc (buflen); /* Check normal operation. */