mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
Fixes illegal memory access errors and arithmetic overflows when running strip on fuzzed binaries.
PR binutils/17512 * coffcode.h (coff_compute_section_file_positions): Report negative page sizes. * elf.c (elf_fake_sections): Handle excessive alignmment powers. (assign_file_positions_for_non_load_sections): Replace assertion with an error message. (rewrite_elf_program_header): Handle excessive segment alignments. * mach-o.c (bfd_mach_o_read_section_32): Likewise. (bfd_mach_o_read_section_64): Likewise. * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to print a bfd name, not %A.
This commit is contained in:
@ -3170,6 +3170,15 @@ coff_compute_section_file_positions (bfd * abfd)
|
||||
This repairs 'ld -r' for arm-wince-pe target. */
|
||||
if (page_size == 0)
|
||||
page_size = 1;
|
||||
|
||||
/* PR 17512: file: 0ac816d3. */
|
||||
if (page_size < 0)
|
||||
{
|
||||
bfd_set_error (bfd_error_file_too_big);
|
||||
(*_bfd_error_handler)
|
||||
(_("%B: page size is too large (0x%x)"), abfd, page_size);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
page_size = PE_DEF_FILE_ALIGNMENT;
|
||||
|
Reference in New Issue
Block a user