diff options
author | Alan Modra <amodra@gmail.com> | 2017-09-24 14:35:33 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-09-24 14:35:33 +0930 |
commit | 0d76029f92182c3682d8be2c833d45bc9a2068fe (patch) | |
tree | 0e51d2aa88733c7f4311d27777aaded0ff7978ad /bfd/dwarf2.c | |
parent | bd61e135492ecf624880e6b78e5fcde3c9716df6 (diff) | |
download | gdb-0d76029f92182c3682d8be2c833d45bc9a2068fe.zip gdb-0d76029f92182c3682d8be2c833d45bc9a2068fe.tar.gz gdb-0d76029f92182c3682d8be2c833d45bc9a2068fe.tar.bz2 |
PR22167, NULL pointer dereference in scan_unit_for_symbols
PR 22167
* dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r-- | bfd/dwarf2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 856c963..d1cf1aa 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; |