Fuzzed files in archives
authorAlan Modra <amodra@gmail.com>
Thu, 27 Oct 2022 05:31:17 +0000 (16:01 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 27 Oct 2022 07:26:51 +0000 (17:56 +1030)
commitffbe89531c2e9bfd81a16241e1d17fff134fab9e
treeff2b5460d7354a8840f7aa49e26fe44ca025ec53
parent686657b66cdfa4834806d33ed0435650e00905e8
Fuzzed files in archives

Given a fuzzed object file in an archive with section size exceeding
file size, objcopy will report an error like "section size (0xfeffffff
bytes) is larger than file size (0x17a bytes)" but will create a copy
of the object laid out for the large section.  That means a large
temporary file on disk that is read back and written to the output
archive, which can take a while.  The output archive is then deleted
due to the error.  Avoid some of this silliness.

* objcopy.c (copy_section): If section contents cannot be read
set output section size to zero.
binutils/objcopy.c