Fix an illegal memory access by readelf when displaying the contents of a corrupt...
authorNick Clifton <nickc@redhat.com>
Thu, 27 Feb 2020 16:28:25 +0000 (16:28 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 27 Feb 2020 16:28:25 +0000 (16:28 +0000)
PR 25526
* readelf.c (process_ia64_vms_dynamic_relocs): Check to see if
get_data is unable to load the string table.

binutils/ChangeLog
binutils/readelf.c

index b15238a0bf3d705c294c65f378c5bae16590048b..24d17c25fb53cf2562474245666d014e4de55cfb 100644 (file)
@@ -1,3 +1,9 @@
+2020-02-27  Nick Clifton  <nickc@redhat.com>
+
+       PR 25526
+       * readelf.c (process_ia64_vms_dynamic_relocs): Check to see if
+       get_data is unable to load the string table.
+
 2020-02-26  Alan Modra  <amodra@gmail.com>
 
        * elfedit.c: Indent labels correctly.
index ee34bd6f1bcc51b2e2701e8913de97012e3b8549..bf84f877fc274ea2fc6d5a3ba0930f9df26b7e71 100644 (file)
@@ -7104,6 +7104,7 @@ dump_ia64_vms_dynamic_fixups (Filedata *                  filedata,
             (unsigned long) fixup->needed);
       lib_name = "???";
     }
+
   printf (_("\nImage fixups for needed library #%d: %s - ident: %lx\n"),
          (int) fixup->fixup_needed, lib_name, (long) fixup->needed_ident);
   printf
@@ -7203,6 +7204,8 @@ process_ia64_vms_dynamic_relocs (Filedata * filedata)
           if (strtab == NULL)
             strtab = get_data (NULL, filedata, dynamic_addr + strtab_off,
                                1, strtab_sz, _("dynamic string section"));
+         if (strtab == NULL)
+           strtab_sz = 0;
           break;
 
         case DT_IA_64_VMS_NEEDED_IDENT: