aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-03-01 02:31:27 +0000
committerMichael Snyder <msnyder@vmware.com>2011-03-01 02:31:27 +0000
commitac50ab3b44a453aef7a0ee53890aded3b696bf31 (patch)
treef2c03a3c81fa359031ec21b833d87c745678a2d2 /gdb/ui-out.c
parentf63fbe86f6082f0e860e3a33e71a7efe6683219d (diff)
downloadgdb-ac50ab3b44a453aef7a0ee53890aded3b696bf31.zip
gdb-ac50ab3b44a453aef7a0ee53890aded3b696bf31.tar.gz
gdb-ac50ab3b44a453aef7a0ee53890aded3b696bf31.tar.bz2
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.
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r--gdb/ui-out.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index 72a34f8..2cd1a54 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))