This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: PR 22509: Check for a NULL symbol pointer when reading COFF relocs
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Wed, 29 Nov 2017 17:11:56 +0000
- Subject: Commit: PR 22509: Check for a NULL symbol pointer when reading COFF relocs
- Authentication-results: sourceware.org; auth=none
Hi Guys,
I am applying the patch below as a fix for PR 22509. This
triggered a seg-fault in objdump when it was tring to display
the relocs in a corrupt COFF file.
Cheers
Nick
bfd/ChangeLog
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.
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 604ba6d8d9..d30cd58c4f 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -5335,7 +5335,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
#else
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))
{