xcoff slurp_armap bounds checking
authorAlan Modra <amodra@gmail.com>
Thu, 19 Dec 2019 11:16:01 +0000 (21:46 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 19 Dec 2019 11:22:47 +0000 (21:52 +1030)
commit228c8f4be0c428369ec6b68e25696863d1e62ed7
treea69cb8af2acba328adf7cf8e59a5ccfab599b288
parentf00901886d0acb7a4d4b177a5cabe8bd9ca2307b
xcoff slurp_armap bounds checking

"count * 8 >= size" might overflow, "count >= size / 8" doesn't.

* coff-rs6000.c (_bfd_xcoff_slurp_armap): Don't overflow when
checking symbol count against section size.  Guard against strlen
running off end of buffer by allocating one more byte and zeroing.
* coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
bfd/ChangeLog
bfd/coff-rs6000.c
bfd/coff64-rs6000.c