diff options
author | Nick Clifton <nickc@redhat.com> | 2015-01-27 15:49:12 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-01-27 15:49:12 +0000 |
commit | 877a8638ba563c667eb5358240334c473d0573a1 (patch) | |
tree | 0482b9e22730c1b0a323a3af2d34c4e1a7a2db49 /bfd/elf64-ppc.c | |
parent | 37e3922eed415bbedd2dd6e46308fe9e03417770 (diff) | |
download | gdb-877a8638ba563c667eb5358240334c473d0573a1.zip gdb-877a8638ba563c667eb5358240334c473d0573a1.tar.gz gdb-877a8638ba563c667eb5358240334c473d0573a1.tar.bz2 |
Fixes for memory access violations triggered by running addr2line on fuzzed binaries.
PR binutils/17512
* addr2line.c (slurp_symtab): If the symcount is zero, free the
symbol table pointer.
* dwarf2.c (concat_filename): Check for an empty directory table.
(scan_unit_for_symbols): Check for reading off the end of the
unit.
(parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
non-string form.
* elf64-ppc.c (opd_entry_value): Fail if there are no relocs
available.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 5a1ee50..8c7c3b7 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -5978,6 +5978,9 @@ opd_entry_value (asection *opd_sec, relocs = ppc64_elf_tdata (opd_bfd)->opd.relocs; if (relocs == NULL) relocs = _bfd_elf_link_read_relocs (opd_bfd, opd_sec, NULL, NULL, TRUE); + /* PR 17512: file: df8e1fd6. */ + if (relocs == NULL) + return (bfd_vma) -1; /* Go find the opd reloc at the sym address. */ lo = relocs; |