This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PR22167, NULL pointer dereference in scan_unit_for_symbols
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sun, 24 Sep 2017 16:11:59 +0930
- Subject: PR22167, NULL pointer dereference in scan_unit_for_symbols
- Authentication-results: sourceware.org; auth=none
PR 22167
* dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
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;
--
Alan Modra
Australia Development Lab, IBM