This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]