aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-26 18:22:07 +0930
committerAlan Modra <amodra@gmail.com>2020-08-26 23:23:44 +0930
commit55e61b8ad977cba772753c8dbba5c81f6b1fa54c (patch)
tree35016a83cf928e7a7fa3531896f592f8c971b130 /bfd/elfxx-mips.c
parent1673aff56987e560ab429beba0d77b85a1c4e064 (diff)
downloadgdb-55e61b8ad977cba772753c8dbba5c81f6b1fa54c.zip
gdb-55e61b8ad977cba772753c8dbba5c81f6b1fa54c.tar.gz
gdb-55e61b8ad977cba772753c8dbba5c81f6b1fa54c.tar.bz2
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.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index fda653e..bc08435 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;