From 08f021c43f4fbd51285c619a95c762f980e01da2 Mon Sep 17 00:00:00 2001 From: Tomasz Kantecki Date: Tue, 5 Dec 2023 13:01:43 +0000 Subject: [PATCH] igzip_cli: fix for potential buffer overrun on 'outfile_name' buffer with strncat() Signed-off-by: Tomasz Kantecki --- programs/igzip_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/igzip_cli.c b/programs/igzip_cli.c index feacbd2..041f977 100644 --- a/programs/igzip_cli.c +++ b/programs/igzip_cli.c @@ -596,7 +596,7 @@ int compress_file(void) allocated_name = malloc_safe(outfile_name_len + 1); outfile_name = allocated_name; strncpy(outfile_name, infile_name, infile_name_len + 1); - strncat(outfile_name, suffix, outfile_name_len + 1); + strncat(outfile_name, suffix, suffix_len); } open_in_file(&in, infile_name);