aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-02-27 16:28:25 +0000
committerNick Clifton <nickc@redhat.com>2020-02-27 16:28:25 +0000
commit736990c44277615e47d5dfab523c70488911624d (patch)
tree98bf1f2044dcdfba764eb5222575e1b4f2e9106d /binutils
parent3608f86c427a907335eb96b8dd6d6d2071d6f4a1 (diff)
downloadgdb-736990c44277615e47d5dfab523c70488911624d.zip
gdb-736990c44277615e47d5dfab523c70488911624d.tar.gz
gdb-736990c44277615e47d5dfab523c70488911624d.tar.bz2
Fix an illegal memory access by readelf when displaying the contents of a corrupt IA64 binary.
PR 25526 * readelf.c (process_ia64_vms_dynamic_relocs): Check to see if get_data is unable to load the string table.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b15238a..24d17c2 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ee34bd6..bf84f87 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -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: