mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-14 02:51:12 +00:00
/libr/bin/format/pe/pe.c fix off by one in strcpy
This commit is contained in:
parent
d9fc1ce9fc
commit
73bddffbf0
@ -2449,7 +2449,7 @@ struct r_bin_pe_section_t* PE_(r_bin_pe_get_sections)(struct PE_(r_bin_pe_obj_t)
|
||||
if (!shdr[i].SizeOfRawData && !shdr[i].Misc.VirtualSize) continue;
|
||||
if (shdr[i].Name[0] == '\0') {
|
||||
char *new_name = r_str_newf ("sect_%d", j);
|
||||
strncpy ((char *)sections[j].name, new_name, R_ARRAY_SIZE(sections[j].name));
|
||||
strncpy ((char *)sections[j].name, new_name, R_ARRAY_SIZE(sections[j].name) - 1);
|
||||
free (new_name);
|
||||
} else {
|
||||
memcpy (sections[j].name, shdr[i].Name, PE_IMAGE_SIZEOF_SHORT_NAME);
|
||||
|
Loading…
x
Reference in New Issue
Block a user