From: Alan Modra Date: Sun, 24 Sep 2017 05:05:33 +0000 (+0930) Subject: PR22167, NULL pointer dereference in scan_unit_for_symbols X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;ds=sidebyside;h=0d76029f92182c3682d8be2c833d45bc9a2068fe;p=binutils-gdb.git PR22167, NULL pointer dereference in scan_unit_for_symbols PR 22167 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index af04da9e69e..57f5ad3b560 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2017-09-24 Alan Modra + + PR 22167 + * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL. + 2017-09-24 Alan Modra PR 22166 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 856c963985c..d1cf1aa71fc 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -3210,7 +3210,8 @@ scan_unit_for_symbols (struct comp_unit *unit) case DW_FORM_block2: case DW_FORM_block4: case DW_FORM_exprloc: - if (*attr.u.blk->data == DW_OP_addr) + if (attr.u.blk->data != NULL + && *attr.u.blk->data == DW_OP_addr) { var->stack = 0;