2011-02-28 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 1 Mar 2011 02:16:56 +0000 (02:16 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 1 Mar 2011 02:16:56 +0000 (02:16 +0000)
* breakpoint.c (breakpoint_adjustment_warning): Make local char
buffers a little bigger, to avoid possibility of an overflow.

gdb/ChangeLog
gdb/breakpoint.c

index 557f89f..8fcf424 100644 (file)
@@ -1,5 +1,8 @@
 2011-02-28  Michael Snyder  <msnyder@vmware.com>
 
+       * breakpoint.c (breakpoint_adjustment_warning): Make local char
+       buffers a little bigger, to avoid possibility of an overflow.
+
        * coffread.c (coff_getfilename): Add check to avoid overflow.
 
        * objc-lang.c (selectors_info): Add a small safety margin to 
index bb9927c..3fb8aab 100644 (file)
@@ -5504,8 +5504,10 @@ static void
 breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
                                int bnum, int have_bnum)
 {
-  char astr1[40];
-  char astr2[40];
+  /* The longest string possibly returned by hex_string_custom
+     is 50 chars.  These must be at least that big for safety.  */
+  char astr1[64];
+  char astr2[64];
 
   strcpy (astr1, hex_string_custom ((unsigned long) from_addr, 8));
   strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));