aboutsummaryrefslogtreecommitdiff
path: root/bfd/cofflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-11-19 08:33:20 +1030
committerAlan Modra <amodra@gmail.com>2022-11-22 08:18:49 +1030
commit38c917d808fdb570ddb1215ccf8233a10484ba91 (patch)
tree38d20b2d880fb2f1226a786fc81e1f8fdb557f0b /bfd/cofflink.c
parente9a20a419b66431766e59dec75265ccdc0bf1046 (diff)
downloadgdb-38c917d808fdb570ddb1215ccf8233a10484ba91.zip
gdb-38c917d808fdb570ddb1215ccf8233a10484ba91.tar.gz
gdb-38c917d808fdb570ddb1215ccf8233a10484ba91.tar.bz2
PR29807, SIGSEGV when linking fuzzed PE object
PR 29807 * cofflink.c (_bfd_coff_generic_relocate_section): Skip relocs against symbols with a NULL section.
Diffstat (limited to 'bfd/cofflink.c')
-rw-r--r--bfd/cofflink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index a5b936f..cd117a4 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -2961,8 +2961,10 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
sec = sections[symndx];
/* PR 19623: Relocations against symbols in
- the absolute sections should ignored. */
- if (bfd_is_abs_section (sec))
+ the absolute sections should ignored.
+ PR 29807: Also ignore relocs against file symbols or
+ other such nonsense in fuzzed objects. */
+ if (sec == NULL || bfd_is_abs_section (sec))
continue;
val = (sec->output_section->vma