readelf looping in process_archive
authorAlan Modra <amodra@gmail.com>
Wed, 25 Mar 2020 11:55:37 +0000 (22:25 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 25 Mar 2020 12:01:07 +0000 (22:31 +1030)
commit4c83662712f80abe9a7d8ef645123347a9de7adb
tree69a20581d3c5783b3e51f0a959f0124a9b387ee2
parentaac88046e6cccf13fc408fc4e515aaf2548fe898
readelf looping in process_archive

With a crafted "negative" ar_hdr.ar_size it is possible to make
readelf loop.  This patch catches the overflow in a file offset
calculation.

* readelf.c (process_archive): Prevent endless loop.
binutils/ChangeLog
binutils/readelf.c