aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-04-11 19:42:31 +0930
committerAlan Modra <amodra@gmail.com>2019-04-11 20:57:09 +0930
commit9bff840e8cc560f5096a43609ed3e0d980733fd9 (patch)
treec94d7d80f89988d7d835301dc64d87797a6b0bf4 /bfd/elflink.c
parentce12121b63145322b4961bbb2b94b939cb916ba7 (diff)
downloadgdb-9bff840e8cc560f5096a43609ed3e0d980733fd9.zip
gdb-9bff840e8cc560f5096a43609ed3e0d980733fd9.tar.gz
gdb-9bff840e8cc560f5096a43609ed3e0d980733fd9.tar.bz2
PR24435, buffer overflow reading dynamic entries
PR 24435 * elflink.c (elf_link_add_object_symbols): Don't read partial dynamic entries from fuzzed objects.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index c796e27..8aae980 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -4076,7 +4076,7 @@ error_free_dyn:
shlink = elf_elfsections (abfd)[elfsec]->sh_link;
for (extdyn = dynbuf;
- extdyn < dynbuf + s->size;
+ extdyn <= dynbuf + s->size - bed->s->sizeof_dyn;
extdyn += bed->s->sizeof_dyn)
{
Elf_Internal_Dyn dyn;