On 11/18/2025 1:52 AM, Stephen Hemminger wrote:
> 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: [email protected]
>
> Signed-off-by: Stephen Hemminger <[email protected]>
> ---
> 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];
there are many other function invoke make_tmp_file(), such as
test_cfgfile_invalid_section_header.
I think we could modify make_tmp_file(): snprintf(filename, PATH_MAX -
NAME_MAX, ...).
> int ret;
> const char *value;
>