aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2011-07-23 16:49:16 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2011-07-23 16:49:16 +0000
commit3807f6133efb54380787dcc5f3a8b4ef1ce30053 (patch)
treeb20f13a3836bd931b5e05c5db4eae15111aa2089
parentc0588ba682a04e58682b370af9e317bc741eefdb (diff)
downloadgdb-3807f6133efb54380787dcc5f3a8b4ef1ce30053.zip
gdb-3807f6133efb54380787dcc5f3a8b4ef1ce30053.tar.gz
gdb-3807f6133efb54380787dcc5f3a8b4ef1ce30053.tar.bz2
2011-07-23 Paul Pluzhnikov <ppluzhnikov@google.com>
* elfread.c (elf_rel_plt_read): Fix off-by-one bug.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/elfread.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e8b5d05..3ba870b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-23 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * elfread.c (elf_rel_plt_read): Fix off-by-one bug.
+
2011-07-22 Pedro Alves <pedro@codesourcery.com>
* i386-nat.c (I386_DR_VACANT, I386_DR_LOCAL_ENABLE)
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 825df0f..ab6dbe3 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -667,14 +667,14 @@ elf_rel_plt_read (struct objfile *objfile, asymbol **dyn_symbol_table)
OBJFILE the symbol is undefined and the objfile having NAME defined
may not yet have been loaded. */
- if (string_buffer_size < name_len + got_suffix_len)
+ if (string_buffer_size < name_len + got_suffix_len + 1)
{
string_buffer_size = 2 * (name_len + got_suffix_len);
string_buffer = xrealloc (string_buffer, string_buffer_size);
}
memcpy (string_buffer, name, name_len);
memcpy (&string_buffer[name_len], SYMBOL_GOT_PLT_SUFFIX,
- got_suffix_len);
+ got_suffix_len + 1);
msym = record_minimal_symbol (string_buffer, name_len + got_suffix_len,
1, address, mst_slot_got_plt, got_plt,