From ac50ab3b44a453aef7a0ee53890aded3b696bf31 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Tue, 1 Mar 2011 02:31:27 +0000 Subject: [PATCH] 2011-02-28 Michael Snyder * ui-out.c (ui_out_field_core_addr): Make local char buffer a little bigger, to avoid possibility of an overflow. --- gdb/ChangeLog | 3 +++ gdb/ui-out.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8fcf424b159..2507c902202 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2011-02-28 Michael Snyder + * 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. diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 72a34f88d9e..2cd1a5471f3 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -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)) -- 2.30.2