Add a check for a NULL table pointer before attempting to compute a DWARF filename.
authorNick Clifton <nickc@redhat.com>
Tue, 17 Apr 2018 13:30:07 +0000 (14:30 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 17 Apr 2018 13:30:07 +0000 (14:30 +0100)
PR 23065
* dwarf2.c (concat_filename): Check for a NULL table pointer.

bfd/ChangeLog
bfd/dwarf2.c

index 3ea3933..eb283d6 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-17  Nick Clifton  <nickc@redhat.com>
+
+       PR 23065
+       * dwarf2.c (concat_filename): Check for a NULL table pointer.
+
 2018-04-16  Nick Clifton  <nickc@redhat.com>
 
        PR 23061
index ca22db7..0f8257f 100644 (file)
@@ -1566,7 +1566,7 @@ concat_filename (struct line_info_table *table, unsigned int file)
 {
   char *filename;
 
-  if (file - 1 >= table->num_files)
+  if (table == NULL || file - 1 >= table->num_files)
     {
       /* FILE == 0 means unknown.  */
       if (file)