aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-11-29 17:12:12 +0000
committerNick Clifton <nickc@redhat.com>2017-11-29 17:12:12 +0000
commit4581a1c7d304ce14e714b27522ebf3d0188d6543 (patch)
treea659e5d058960edd8f6ea74d6d8a4f7c99bbfa6a /bfd
parentf6f1d339d4169a60362f1438221bd03f8f021f04 (diff)
downloadgdb-4581a1c7d304ce14e714b27522ebf3d0188d6543.zip
gdb-4581a1c7d304ce14e714b27522ebf3d0188d6543.tar.gz
gdb-4581a1c7d304ce14e714b27522ebf3d0188d6543.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/coffcode.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 601272d..c23ac59 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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>
* po/Make-in (datadir): Define as @datadir@.
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 604ba6d..d30cd58 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))
{