readelf: catch archive_file_size of -1
authorAlan Modra <amodra@gmail.com>
Fri, 30 Jul 2021 03:37:12 +0000 (13:07 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 30 Jul 2021 06:03:07 +0000 (15:33 +0930)
commit237877b8183a23ecc889b5c796c210aac9cfb742
treeaefe79fcfa2b5a985b22b42ee423716a66a172fb
parent5cfe19e51ee06feb191b33a934bcf6cfaaace7b1
readelf: catch archive_file_size of -1

Fuzzers might put -1 in arhdr.ar_size.  If the size is rounded up to
and even number of bytes we get zero.

* readelf.c (process_archive): Don't round up archive_file_size.
Do round up next_arhdr_offset calculation.
binutils/readelf.c