mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
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.
This commit is contained in:
@@ -2604,7 +2604,15 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
|
||||
{
|
||||
/* PR 17636: Call non-fatal so that we return to our parent who
|
||||
may need to tidy temporary files. */
|
||||
non_fatal (_("Unable to change endianness of input file(s)"));
|
||||
non_fatal (_("unable to change endianness of '%s'"),
|
||||
bfd_get_archive_filename (ibfd));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (ibfd->read_only)
|
||||
{
|
||||
non_fatal (_("unable to modify '%s' due to errors"),
|
||||
bfd_get_archive_filename (ibfd));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user