From: Ed Maste Date: Mon, 9 Feb 2015 21:55:34 +0000 (-0800) Subject: Avoid incrementing uninitialized variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35181b3eaa305458f1a6ff04b97cf13e2ef10946;p=binutils-gdb.git Avoid incrementing uninitialized variable * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing uninitialized and unused variable. * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 21ce154ddc5..650e8eea5a7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2015-02-09 Ed Maste + + * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing + uninitialized and unused variable. + * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise. + 2015-02-09 Alan Modra * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index dd4dbdc549d..452ec54bda9 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -5187,7 +5187,7 @@ bad_return: if (plt_sym_val == NULL) goto bad_return; - for (i = 0; i < count; i++, p++) + for (i = 0; i < count; i++) plt_sym_val[i] = -1; plt_offset = bed->plt->plt_entry_size; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 5fd727b4f75..fd9c7265613 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -5569,7 +5569,7 @@ bad_return: if (plt_sym_val == NULL) goto bad_return; - for (i = 0; i < count; i++, p++) + for (i = 0; i < count; i++) plt_sym_val[i] = -1; plt_offset = bed->plt_entry_size;