From 274441f62a61dd5329b3a20d8356759bd2ff2d93 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 12 Jan 2026 21:23:33 +0100 Subject: [PATCH] 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. --- inet/tst-if_nameindex.c | 2 ++ 1 file changed, 2 insertions(+) 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. */