mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
String length is known, use memcpy instead of strcpy.
This commit is contained in:
parent
20cfdc3022
commit
ce4c83d45b
@ -4841,8 +4841,9 @@ phdr_callback_mock (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
|
||||
auto ptr = s_phdrData.push_next();
|
||||
if (info->dlpi_name)
|
||||
{
|
||||
ptr->dlpi_name = (char*)tracy_malloc (strlen (info->dlpi_name) + 1);
|
||||
strcpy (ptr->dlpi_name, info->dlpi_name);
|
||||
size_t sz = strlen (info->dlpi_name) + 1;
|
||||
ptr->dlpi_name = (char*)tracy_malloc (sz);
|
||||
memcpy (ptr->dlpi_name, info->dlpi_name, sz);
|
||||
}
|
||||
else ptr->dlpi_name = nullptr;
|
||||
ptr->dlpi_addr = info->dlpi_addr;
|
||||
|
Loading…
Reference in New Issue
Block a user