PR26348, Malloc error in write_zeros
authorAlan Modra <amodra@gmail.com>
Wed, 12 Aug 2020 10:48:43 +0000 (20:18 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 12 Aug 2020 22:39:08 +0000 (08:09 +0930)
commit75e100a30d5dfdd3ac2b0391c17173645fc77633
treea5543e1a6a43b603bc654afe5b81edcf8959b1a9
parent6d8a0a5e90936d4bea9bf1ce9b4e1c22d9aaccae
PR26348, Malloc error in write_zeros

This adds a few more sanity checks on ELF objects, and a BFD flag to
disable objcopy and strip when fuzzed input files belong in the "too
hard" basket.

bfd/
PR 26348
* bfd.c (struct bfd): Add read_only.
* elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
Set read_only on warning.
(elf_object_p): Sanity check program header alignment.  Set
read_only on warning.
* bfd-in2.h: Regenerate.
binutils/
PR 26348
* objcopy.c (copy_object): Report file name with endian error.
Error and return on abfd->read_only.
bfd/ChangeLog
bfd/bfd-in2.h
bfd/bfd.c
bfd/elfcode.h
binutils/ChangeLog
binutils/objcopy.c