diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2011-07-23 16:49:16 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2011-07-23 16:49:16 +0000 |
commit | 3807f6133efb54380787dcc5f3a8b4ef1ce30053 (patch) | |
tree | b20f13a3836bd931b5e05c5db4eae15111aa2089 /gdb/elfread.c | |
parent | c0588ba682a04e58682b370af9e317bc741eefdb (diff) | |
download | gdb-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.c | 4 |
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, |