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 /binutils | |
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 'binutils')
-rw-r--r-- | binutils/ChangeLog | 3 | ||||
-rw-r--r-- | binutils/addr2line.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index a017c64..53ec072 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -4,6 +4,9 @@ * dlltool.c (identify_search_archive): If the last archive was the same as the current archive, terminate the loop. + * addr2line.c (slurp_symtab): If the symcount is zero, free the + symbol table pointer. + 2015-01-23 Nick Clifton <nickc@redhat.com> * nlmconv.c (powerpc_mangle_relocs): Fix build errors introduced diff --git a/binutils/addr2line.c b/binutils/addr2line.c index d37145e..e121c74 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -140,6 +140,14 @@ slurp_symtab (bfd *abfd) syms = xmalloc (storage); symcount = bfd_canonicalize_dynamic_symtab (abfd, syms); } + + /* PR 17512: file: 2a1d3b5b. + Do not pretend that we have some symbols when we don't. */ + if (symcount <= 0) + { + free (syms); + syms = NULL; + } } /* These global variables are used to pass information between |