From 55e61b8ad977cba772753c8dbba5c81f6b1fa54c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 26 Aug 2020 18:22:07 +0930 Subject: [PATCH] PR26475 UBSAN: elfxx-mips.c:12180 null pointer memset Another memset(0,0,0) PR 26475 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check sstubs->contents != NULL. --- bfd/ChangeLog | 6 ++++++ bfd/elfxx-mips.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 20a02d9238f..3a85c3eb9a5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-08-26 Alan Modra + + PR 26475 + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check + sstubs->contents != NULL. + 2020-08-26 Alan Modra PR 26453 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index fda653e1afc..bc0843508e0 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -12172,7 +12172,8 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd, s->contents)); /* Clean up a dummy stub function entry in .text. */ - if (htab->sstubs != NULL) + if (htab->sstubs != NULL + && htab->sstubs->contents != NULL) { file_ptr dummy_offset; -- 2.30.2