Fix a snafu setting up the string table read in from a COFF file.
PR binutils/17512 * coffgen.c (_bfd_coff_read_string_table): Test allocation of string table before clearing the first few bytes.
This commit is contained in:
parent
3cfdb7812c
commit
cd11f78f81
@ -1,3 +1,9 @@
|
|||||||
|
2014-11-21 Alexander Cherepanov <cherepan@mccme.ru>
|
||||||
|
|
||||||
|
PR binutils/17512
|
||||||
|
* coffgen.c (_bfd_coff_read_string_table): Test allocation of
|
||||||
|
string table before clearing the first few bytes.
|
||||||
|
|
||||||
2014-11-21 Terry Guo <terry.guo@arm.com>
|
2014-11-21 Terry Guo <terry.guo@arm.com>
|
||||||
|
|
||||||
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Support FPv5.
|
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Support FPv5.
|
||||||
|
@ -1711,15 +1711,15 @@ _bfd_coff_read_string_table (bfd *abfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
strings = (char *) bfd_malloc (strsize + 1);
|
strings = (char *) bfd_malloc (strsize + 1);
|
||||||
|
if (strings == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* PR 17521 file: 079-54929-0.004.
|
/* PR 17521 file: 079-54929-0.004.
|
||||||
A corrupt file could contain an index that points into the first
|
A corrupt file could contain an index that points into the first
|
||||||
STRING_SIZE_SIZE bytes of the string table, so make sure that
|
STRING_SIZE_SIZE bytes of the string table, so make sure that
|
||||||
they are zero. */
|
they are zero. */
|
||||||
memset (strings, 0, STRING_SIZE_SIZE);
|
memset (strings, 0, STRING_SIZE_SIZE);
|
||||||
|
|
||||||
if (strings == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (bfd_bread (strings + STRING_SIZE_SIZE, strsize - STRING_SIZE_SIZE, abfd)
|
if (bfd_bread (strings + STRING_SIZE_SIZE, strsize - STRING_SIZE_SIZE, abfd)
|
||||||
!= strsize - STRING_SIZE_SIZE)
|
!= strsize - STRING_SIZE_SIZE)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user