Check for a NULL symbol pointer when reading relocs from a COFF based file.

PR 22509
	* coffcode.h (coff_slurp_reloc_table): Check for a NULL symbol
	pointer when processing relocs.
This commit is contained in:
Nick Clifton 2017-11-29 17:12:12 +00:00
parent f6f1d339d4
commit 4581a1c7d3
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-11-29 Nick Clifton <nickc@redhat.com>
PR 22509
* coffcode.h (coff_slurp_reloc_table): Check for a NULL symbol
pointer when processing relocs.
2017-11-29 Stefan Stroe <stroestefan@gmail.com> 2017-11-29 Stefan Stroe <stroestefan@gmail.com>
* po/Make-in (datadir): Define as @datadir@. * po/Make-in (datadir): Define as @datadir@.

View File

@ -5335,7 +5335,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
#else #else
cache_ptr->address = dst.r_vaddr; cache_ptr->address = dst.r_vaddr;
if (dst.r_symndx != -1) if (dst.r_symndx != -1 && symbols != NULL)
{ {
if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd)) if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd))
{ {