From 18e362baa9dd7f94376b7923f0901bb7aa5db184 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Mon, 12 May 2025 00:54:21 +0100 Subject: [PATCH] Use memcpy instead of strcpy --- pe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pe.c b/pe.c index 725adfc..1cbd650 100644 --- a/pe.c +++ b/pe.c @@ -1162,7 +1162,7 @@ static void write_implib (struct export_name *export_names, unsigned long num_na offset2 += write_data (outfile, §ion_descriptor_short, sizeof (section_descriptor_short)); memset (§ion_descriptor_short, 0, sizeof (section_descriptor_short)); - strcpy ((char *) section_descriptor_short.z.SectionName, ".idata$2"); + memcpy ((char *) section_descriptor_short.z.SectionName, ".idata$2", 8); integer_to_array (0xC0000040, section_descriptor_short.b, 4); integer_to_array (2, section_descriptor_short.c, 4); @@ -1171,7 +1171,7 @@ static void write_implib (struct export_name *export_names, unsigned long num_na offset2 += write_data (outfile, §ion_descriptor_short, sizeof (section_descriptor_short)); memset (§ion_descriptor_short, 0, sizeof (section_descriptor_short)); - strcpy ((char *) section_descriptor_short.z.SectionName, ".idata$6"); + memcpy ((char *) section_descriptor_short.z.SectionName, ".idata$6", 8); integer_to_array (0, section_descriptor_short.b, 4); integer_to_array (3, section_descriptor_short.c, 4); @@ -1180,7 +1180,7 @@ static void write_implib (struct export_name *export_names, unsigned long num_na offset2 += write_data (outfile, §ion_descriptor_short, sizeof (section_descriptor_short)); memset (§ion_descriptor_short, 0, sizeof (section_descriptor_short)); - strcpy ((char *) section_descriptor_short.z.SectionName, ".idata$4"); + memcpy ((char *) section_descriptor_short.z.SectionName, ".idata$4", 8); integer_to_array (0xC0000040, section_descriptor_short.b, 4); integer_to_array (0, section_descriptor_short.c, 4); @@ -1189,7 +1189,7 @@ static void write_implib (struct export_name *export_names, unsigned long num_na offset2 += write_data (outfile, §ion_descriptor_short, sizeof (section_descriptor_short)); memset (§ion_descriptor_short, 0, sizeof (section_descriptor_short)); - strcpy ((char *) section_descriptor_short.z.SectionName, ".idata$5"); + memcpy ((char *) section_descriptor_short.z.SectionName, ".idata$5", 8); integer_to_array (0xC0000040, section_descriptor_short.b, 4); integer_to_array (0, section_descriptor_short.c, 4); -- 2.34.1