[PATCH v3 5/6] test: fix impossible format-truncation in cfgfiles

Stephen Hemminger stephen at networkplumber.org
Mon Nov 17 18:52:12 CET 2025


Although, it is not possible on Linux (which always uses /tmp)
the compiler complains about possible snprintf() truncation.
Simplest fix is to just increase the size of the filename variable.

Fixes: be22019a58c4 ("test: restore cfgfile tests")
Cc: stable at dpdk.org

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 app/test/test_cfgfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_cfgfile.c b/app/test/test_cfgfile.c
index b189d9d7a5..823b48e1fa 100644
--- a/app/test/test_cfgfile.c
+++ b/app/test/test_cfgfile.c
@@ -148,7 +148,7 @@ static int
 test_cfgfile_realloc_sections(void)
 {
 	struct rte_cfgfile *cfgfile;
-	char filename[PATH_MAX];
+	char filename[PATH_MAX + NAME_MAX];
 	int ret;
 	const char *value;
 
-- 
2.51.0



More information about the stable mailing list