From: Alan Modra Date: Mon, 25 Sep 2017 10:16:34 +0000 (+0930) Subject: PR22201, DW_AT_name with out of bounds reference X-Git-Tag: users/gbenson/thread_db-test/2017-11-22~832 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11855d8a1f11b102a702ab76e95b22082cccf2f8;p=thirdparty%2Fbinutils-gdb.git PR22201, DW_AT_name with out of bounds reference DW_AT_name ought to always have a string value. PR 22201 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it has string form. (parse_comp_unit): Likewise. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index adbc014b5c1..ee286c46e1c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2017-09-25 Alan Modra + + PR 22201 + * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it + has string form. + (parse_comp_unit): Likewise. + 2017-09-25 Alan Modra PR 22200 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 8abb3f0b37a..9ae5fba6379 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -3225,7 +3225,8 @@ scan_unit_for_symbols (struct comp_unit *unit) switch (attr.name) { case DW_AT_name: - var->name = attr.u.str; + if (is_str_attr (attr.form)) + var->name = attr.u.str; break; case DW_AT_decl_file: @@ -3477,7 +3478,8 @@ parse_comp_unit (struct dwarf2_debug *stash, break; case DW_AT_name: - unit->name = attr.u.str; + if (is_str_attr (attr.form)) + unit->name = attr.u.str; break; case DW_AT_low_pc: