Theoretically, in functions core_addr_to_string_nz() and
core_addr_to_string(), strcat() can overflow, so use a safe
approach using xsnprintf().
Change-Id: Ib9437450b3634dc35077234f462a03a8640242d4
{
char *str = get_print_cell ();
- strcpy (str, "0x");
- strcat (str, phex (addr));
+ xsnprintf (str, PRINT_CELL_SIZE, "0x%s", phex (addr));
return str;
}
{
char *str = get_print_cell ();
- strcpy (str, "0x");
- strcat (str, phex_nz (addr));
+ xsnprintf (str, PRINT_CELL_SIZE, "0x%s", phex_nz (addr));
return str;
}