aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-09-03 08:18:15 +0930
committerAlan Modra <amodra@gmail.com>2021-09-03 11:45:58 +0930
commitf2cfdb748606b3e634050b8f7030e5e7783a4232 (patch)
tree33451f7ecccac5019f980a9f8f7ecfc7f472d5e6 /bfd
parent174fe10cb6809390b38e9a3bc2bf88e3eddfe5ee (diff)
downloadgdb-f2cfdb748606b3e634050b8f7030e5e7783a4232.zip
gdb-f2cfdb748606b3e634050b8f7030e5e7783a4232.tar.gz
gdb-f2cfdb748606b3e634050b8f7030e5e7783a4232.tar.bz2
ubsan: alpha: member access within null pointer
* elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf64-alpha.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 6f5eead..6427406 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -3191,7 +3191,8 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info,
}
/* Can't relax dynamic symbols. */
- if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info))
+ if (info->h != NULL
+ && alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info))
return true;
changed_contents = info->changed_contents;