PR24236, Heap buffer overflow in _bfd_archive_64_bit_slurp_armap
authorAlan Modra <amodra@gmail.com>
Tue, 19 Feb 2019 21:51:24 +0000 (08:21 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 20 Feb 2019 01:20:07 +0000 (11:50 +1030)
commit8abac8031ed369a2734b1cdb7df28a39a54b4b49
treee6a6f1ce759adb9afb1f515aa9347d06541b0f16
parent7ae39e2d406dbec568c5ffd462119037b994fdf9
PR24236, Heap buffer overflow in _bfd_archive_64_bit_slurp_armap

PR 24236
* archive64.c (_bfd_archive_64_bit_slurp_armap): Move code adding
sentinel NUL to string buffer nearer to loop where it is used.
Don't go past sentinel when scanning strings, and don't write
NUL again.
* archive.c (do_slurp_coff_armap): Simplify string handling to
archive64.c style.
bfd/ChangeLog
bfd/archive.c
bfd/archive64.c