From: Paul Pluzhnikov Date: Sat, 23 Jul 2011 16:49:16 +0000 (+0000) Subject: 2011-07-23 Paul Pluzhnikov X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3807f6133efb54380787dcc5f3a8b4ef1ce30053;p=binutils-gdb.git 2011-07-23 Paul Pluzhnikov * elfread.c (elf_rel_plt_read): Fix off-by-one bug. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e8b5d057c36..3ba870bb894 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2011-07-23 Paul Pluzhnikov + + * elfread.c (elf_rel_plt_read): Fix off-by-one bug. + 2011-07-22 Pedro Alves * i386-nat.c (I386_DR_VACANT, I386_DR_LOCAL_ENABLE) diff --git a/gdb/elfread.c b/gdb/elfread.c index 825df0f1da6..ab6dbe3c0e6 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,