2011-02-28 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 1 Mar 2011 02:31:27 +0000 (02:31 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 1 Mar 2011 02:31:27 +0000 (02:31 +0000)
* ui-out.c (ui_out_field_core_addr): Make local char buffer
a little bigger, to avoid possibility of an overflow.

gdb/ChangeLog
gdb/ui-out.c

index 8fcf424b159377c455141274bd3aee51354de7ff..2507c9022021c305ff43b81bcb01281ac6d2659a 100644 (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.
 
index 72a34f88d9efc2bb44aca270128b0ba15c7fcb0e..2cd1a5471f36371056ef5ed80fbb41bee04d1c67 100644 (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))