diff options
author | Nick Clifton <nickc@redhat.com> | 2017-07-24 13:49:22 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-07-24 13:49:22 +0100 |
commit | ca4cf9b9c622a5695e01f7f5815a7382a31fcf51 (patch) | |
tree | f2ecc74aa1b10a2cf2b651a32ad4378909234854 /binutils | |
parent | e8d84ca1b46f899b0b140fdd146fc7b14515267b (diff) | |
download | gdb-ca4cf9b9c622a5695e01f7f5815a7382a31fcf51.zip gdb-ca4cf9b9c622a5695e01f7f5815a7382a31fcf51.tar.gz gdb-ca4cf9b9c622a5695e01f7f5815a7382a31fcf51.tar.bz2 |
Fix address violation errors parsing corrupt binary files.
PR 21813
binutils* rddbg.c (read_symbol_stabs_debugging_info): Check for an empty
string whilst concatenating symbol names.
bfd * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
of the relocs to the canonicalize_one_reloc routine.
* mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
for the _bfd_mach_o_canonicalize_one_reloc field.
* mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
res_base parameter. Use to check for corrupt pair relocs.
* mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
Likewise.
* mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
Likewise.
* mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
Likewise.
* vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
enough data in the record before attempting to parse it.
(_bfd_vms_slurp_eeom): Likewise.
(_bfd_vms_slurp_egsd): Check for an invalid section index.
(image_set_ptr): Likewise.
(alpha_vms_slurp_relocs): Likewise.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/rddbg.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 0d42604..920e938 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-07-24 Nick Clifton <nickc@redhat.com> + + PR 21813 + * rddbg.c (read_symbol_stabs_debugging_info): Check for an empty + string whilst concatenating symbol names. + 2017-07-21 Nick Clifton <nickc@redhat.com> * po/fr.po: Updated French translation. diff --git a/binutils/rddbg.c b/binutils/rddbg.c index 1d8c447..b978060 100644 --- a/binutils/rddbg.c +++ b/binutils/rddbg.c @@ -303,7 +303,8 @@ read_symbol_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount, return FALSE; f = NULL; - while (s[strlen (s) - 1] == '\\' + while (strlen (s) > 0 + && s[strlen (s) - 1] == '\\' && ps + 1 < symend) { char *sc, *n; |