2011-02-28 Michael Snyder <msnyder@vmware.com>

* ui-out.c (ui_out_field_core_addr): Make local char buffer
	a little bigger, to avoid possibility of an overflow.
This commit is contained in:
Michael Snyder 2011-03-01 02:31:27 +00:00
parent f63fbe86f6
commit ac50ab3b44
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2011-02-28 Michael Snyder <msnyder@vmware.com>
* ui-out.c (ui_out_field_core_addr): Make local char buffer
a little bigger, to avoid possibility of an overflow.
* breakpoint.c (breakpoint_adjustment_warning): Make local char
buffers a little bigger, to avoid possibility of an overflow.

View File

@ -492,7 +492,9 @@ ui_out_field_core_addr (struct ui_out *uiout,
struct gdbarch *gdbarch,
CORE_ADDR address)
{
char addstr[20];
/* Maximum size string returned by hex_string_custom is 50 chars.
This buffer must be bigger than that, for safety. */
char addstr[64];
int addr_bit = gdbarch_addr_bit (gdbarch);
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))