PR26475 UBSAN: elfxx-mips.c:12180 null pointer memset

Alan Modra amodra@gmail.com
Wed Aug 26 13:49:17 GMT 2020


Another memset(0,0,0)

	PR 26475
	* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
	sstubs->contents != NULL.

diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index fda653e1af..bc0843508e 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;
 

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list