From f2cfdb748606b3e634050b8f7030e5e7783a4232 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 3 Sep 2021 08:18:15 +0930 Subject: ubsan: alpha: member access within null pointer * elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB. --- bfd/elf64-alpha.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bfd') 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; -- cgit v1.1