Prevent a memory exhaustion problem when trying to read in strings from a COFF binary with a corrupt string table size.

PR 22507
	* coffgen.c (_bfd_coff_read_string_table): Check for an excessive
	size of the external string table.
This commit is contained in:
Nick Clifton 2017-11-28 18:00:29 +00:00
parent ff174d3ffa
commit b0029dce68
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2017-11-28 Nick Clifton <nickc@redhat.com>
PR 22507
* coffgen.c (_bfd_coff_read_string_table): Check for an excessive
size of the external string table.
2017-11-28 Nick Clifton <nickc@redhat.com>
PR 22506

View File

@ -1718,7 +1718,7 @@ _bfd_coff_read_string_table (bfd *abfd)
#endif
}
if (strsize < STRING_SIZE_SIZE)
if (strsize < STRING_SIZE_SIZE || strsize > bfd_get_file_size (abfd))
{
_bfd_error_handler
/* xgettext: c-format */