cygcheck: Use snprintf instead of multiple strcat
This not only simplifies the code but also fixes potential memory corruption Fixes Coverity CID 66952 Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
		| @@ -311,10 +311,7 @@ pathlike::check_existence (const char *fn, int showall, int verbose, | |||||||
| 			   char* first, const char *ext1, const char *ext2) | 			   char* first, const char *ext1, const char *ext2) | ||||||
| { | { | ||||||
|   char file[4000]; |   char file[4000]; | ||||||
|   strcpy (file, dir); |   snprintf (file, sizeof file, "%s%s%s%s", dir, fn, ext1, ext2); | ||||||
|   strcat (file, fn); |  | ||||||
|   strcat (file, ext1); |  | ||||||
|   strcat (file, ext2); |  | ||||||
|  |  | ||||||
|   wide_path wpath (file); |   wide_path wpath (file); | ||||||
|   if (GetFileAttributesW (wpath) != (DWORD) - 1) |   if (GetFileAttributesW (wpath) != (DWORD) - 1) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user