asan: _bfd_pei_slurp_codeview_record use of uninit value
authorAlan Modra <amodra@gmail.com>
Mon, 29 Jun 2020 00:21:07 +0000 (09:51 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 29 Jun 2020 00:39:14 +0000 (10:09 +0930)
commit07d22f648e56d7276fa7a4a73438005448c406fb
treeed775472361aa5b8a78aec9e7a3a642e81480b6f
parent279edac53db8fa6482ee3e305c9627f788fd2699
asan: _bfd_pei_slurp_codeview_record use of uninit value

Fixes some seriously careless code.  bfd_bread return value is
(bfd_size_type)-1 on error.  "if (bfd_bread (...) < 4)" does not check
for an error since bfd_size_type is unsigned.  In any case, I think we
should be reading and checking the requested length.

* peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
return value of bfd_bread.  Don't read more than requested length.
Sanity check length.  Properly terminate file name.
bfd/ChangeLog
bfd/peXXigen.c