fix out-of-bounds access in elf.c:find_link
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 24 Jun 2017 17:40:41 +0000 (18:40 +0100)
committerAlan Modra <amodra@gmail.com>
Sun, 25 Jun 2017 00:59:57 +0000 (10:29 +0930)
commit5cc4ca837deac7dc962d8a3741aa120c50ab41da
tree999fbc5454d04072b52522b07be73b64d69b041d
parentb21351faa29dfa6deab3afcb5a2ee78548239274
fix out-of-bounds access in elf.c:find_link

The out-of-bounds access is reproducible on 'ia64-strip' command
(see sample from https://bugs.gentoo.org/show_bug.cgi?id=622500)

The output file contains less section than original one.
This tricks 'hint' access to go out-of-bounds:

* elf.c (find_link): Bounds check "hint".
bfd/ChangeLog
bfd/elf.c