igzip_cli: fix for potential buffer overrun on 'outfile_name' buffer with strncat()

Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
This commit is contained in:
Tomasz Kantecki 2023-12-05 13:01:43 +00:00 committed by Pablo de Lara
parent 722144ee75
commit 08f021c43f

View File

@ -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);