aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-11-27 12:19:10 +0000
committerNick Clifton <nickc@redhat.com>2014-11-27 12:19:10 +0000
commit1036838a771b96ad9428e8fc7ecc45d3d8e056ce (patch)
treeb2908f515505401f6bada294ce7a2ca23797c5d5 /bfd/elf.c
parent608ce2f3c8b1fb309f50b6426389282ec6031323 (diff)
downloadgdb-1036838a771b96ad9428e8fc7ecc45d3d8e056ce.zip
gdb-1036838a771b96ad9428e8fc7ecc45d3d8e056ce.tar.gz
gdb-1036838a771b96ad9428e8fc7ecc45d3d8e056ce.tar.bz2
Fixes a few more memory access violations exposed by fuzzed binaries.
PR binutils/17512 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Warn about and correct a discrepancy between the isymMax and ifdMax values in the symbolic header. * elf.c (_bfd_elf_print_private_bfd_data): Fix the range check scanning the external dynamic entries.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index d3a1bb4..de8d97f 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1254,7 +1254,9 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
extdyn = dynbuf;
extdynend = extdyn + s->size;
- for (; extdyn < extdynend; extdyn += extdynsize)
+ /* PR 17512: file: id:000006,sig:06,src:000000,op:flip4,pos:5664.
+ Fix range check. */
+ for (; extdyn <= (extdynend - extdynsize); extdyn += extdynsize)
{
Elf_Internal_Dyn dyn;
const char *name = "";