ubsan: alpha: member access within null pointer
authorAlan Modra <amodra@gmail.com>
Thu, 2 Sep 2021 22:48:15 +0000 (08:18 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 3 Sep 2021 02:15:58 +0000 (11:45 +0930)
* elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB.

bfd/elf64-alpha.c

index 6f5eeadf256b21c6ca562564a72bc367c384cb4a..6427406fb19ed0c51ef4ceed178d67778661b669 100644 (file)
@@ -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;