From: Samuel Thibault Date: Mon, 12 Jan 2026 20:23:33 +0000 (+0100) Subject: tst-if_nameindex.c: Fix minimum buffer size X-Git-Tag: glibc-2.43~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=274441f62a61dd5329b3a20d8356759bd2ff2d93;p=thirdparty%2Fglibc.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. --- 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. */