diff options
author | Nick Clifton <nickc@redhat.com> | 2019-06-28 15:30:43 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-06-28 15:30:43 +0100 |
commit | 7e56c51c7932cfdb178e9457011d09d53e98937b (patch) | |
tree | f2396eec4ec8a9ce289c71fdc5ef2c745798dd59 /binutils | |
parent | 781152ec18f56726c750cc0812a740396e4ec820 (diff) | |
download | gdb-7e56c51c7932cfdb178e9457011d09d53e98937b.zip gdb-7e56c51c7932cfdb178e9457011d09d53e98937b.tar.gz gdb-7e56c51c7932cfdb178e9457011d09d53e98937b.tar.bz2 |
Prevent attempts to allocate excessive amounts of memory when parsing corrupt ELF files.
PR 24708
* elf.c (_bfd_elf_slurp_version_tables): Check for an excessively
large version reference section.
* compress.c (bfd_get_full_section_contents): Check for an
uncompressed section whose size is larger than the file size.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 3 | ||||
-rw-r--r-- | binutils/objdump.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e9f83e6..d723171 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -2,7 +2,8 @@ PR 24707 * objdump.c (slurp_symtab): Fail with a helpful error message if - the symbol table is too large. + the symbol table is too large. Skip this check for MMO format + files. 2019-06-26 Nick Clifton <nickc@redhat.com> diff --git a/binutils/objdump.c b/binutils/objdump.c index 32e6f24..6812ba7 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -708,7 +708,11 @@ slurp_symtab (bfd *abfd) off_t filesize = bfd_get_file_size (abfd); /* qv PR 24707. */ - if (filesize > 0 && filesize < storage) + if (filesize > 0 + && filesize < storage + /* The MMO file format supports its own special compression + technique, so its sections can be larger than the file size. */ + && bfd_get_flavour (abfd) != bfd_target_mmo_flavour) { bfd_nonfatal_message (bfd_get_filename (abfd), abfd, NULL, _("error: symbol table size (%#lx) is larger than filesize (%#lx)"), |