aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
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 /gdb/elfread.c
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.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c4
1 files changed, 2 insertions, 2 deletions
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,