Bug 23686, two segment faults in nm
authorAlan Modra <amodra@gmail.com>
Thu, 20 Sep 2018 05:59:17 +0000 (15:29 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 20 Sep 2018 06:03:45 +0000 (15:33 +0930)
commit30838132997e6a3cfe3ec11c58b32b22f6f6b102
treed27a866fa48412d72a717c31871b18ed4ebbf824
parent4ee9b0c53a8055b869dfe424846bc00eb0cd0c8f
Bug 23686, two segment faults in nm

Fixes the bugs exposed by the testcases in the PR, plus two more bugs
I noticed when looking at _bfd_stab_section_find_nearest_line.

PR 23686
* dwarf2.c (read_section): Error when attempting to malloc
"(bfd_size_type) -1".
* syms.c (_bfd_stab_section_find_nearest_line): Bounds check
function_name.  Bounds check reloc address.  Formatting.  Ensure
.stabstr zero terminated.
bfd/ChangeLog
bfd/dwarf2.c
bfd/syms.c