[ARC] Improved robustness. Return FALSE in case of NULL pointer.
authorCupertino Miranda <cmiranda@synopsys.com>
Fri, 2 Mar 2018 16:33:48 +0000 (17:33 +0100)
committerCupertino Miranda <cmiranda@synopsys.com>
Mon, 1 Oct 2018 11:42:11 +0000 (12:42 +0100)
bfd/
2018-03-01  Cupertino Miranda <cmiranda@synopsys.com>

* elf32-arc.c (elf_arc_finish_dynamic_symbol) Return FALSE in case
arc_htab is NULL.

bfd/elf32-arc.c

index f498668fd51bc778cdb9dcb4cafaf9c27f612929..3f60d097e62bab5781766fa2adc4f79dd4d0b830 100644 (file)
@@ -2436,6 +2436,9 @@ elf_arc_finish_dynamic_symbol (bfd * output_bfd,
     {
       struct elf_arc_link_hash_table *arc_htab = elf_arc_hash_table (info);
 
+      if (arc_htab == NULL)
+       return FALSE;
+
       if (h->dynindx == -1
          || (h->root.type != bfd_link_hash_defined
              && h->root.type != bfd_link_hash_defweak)