PR26475 UBSAN: elfxx-mips.c:12180 null pointer memset
authorAlan Modra <amodra@gmail.com>
Wed, 26 Aug 2020 08:52:07 +0000 (18:22 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 26 Aug 2020 13:53:44 +0000 (23:23 +0930)
Another memset(0,0,0)

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

bfd/ChangeLog
bfd/elfxx-mips.c

index 20a02d9238f60fad95d2b74e6655179f35a67bbf..3a85c3eb9a5de3fe4da324f06d12d77fc13b265d 100644 (file)
@@ -1,3 +1,9 @@
+2020-08-26  Alan Modra  <amodra@gmail.com>
+
+       PR 26475
+       * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
+       sstubs->contents != NULL.
+
 2020-08-26  Alan Modra  <amodra@gmail.com>
 
        PR 26453
index fda653e1afccf441269f7800b5f47fb98016bc17..bc0843508e0040796c9007be0bc2634de615a528 100644 (file)
@@ -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;