pef: sanity check before malloc
authorAlan Modra <amodra@gmail.com>
Sat, 29 Oct 2022 03:46:29 +0000 (14:16 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 29 Oct 2022 04:53:58 +0000 (15:23 +1030)
commitbb94ac4f95dd11c87d84eea533fe4f3218a48583
tree52bbffbb1de5fc21ac93e450f473c2eba62802b9
parentc5d4b1b6046a77b04ad180d0974221371779599a
pef: sanity check before malloc

And do the sanity check in a way that can't overflow.

* pef.c (bfd_pef_parse_function_stubs): Sanity check header
imported_library_count and total_imported_symbol_count before
allocating memory.
bfd/pef.c