PR28674, objdump crash

Alan Modra amodra@gmail.com
Thu Dec 9 22:07:24 GMT 2021


Not returning an error indication here leaves the attribute
uninitialised, which then leads to intemperate behaviour.

	PR 28674
	* dwarf2.c (read_attribute_value): Return NULL on trying to read
	past end of attributes.

diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 04f56a7b187..1c69b3d1236 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -1199,7 +1199,7 @@ read_attribute_value (struct attribute *  attr,
     {
       _bfd_error_handler (_("DWARF error: info pointer extends beyond end of attributes"));
       bfd_set_error (bfd_error_bad_value);
-      return info_ptr;
+      return NULL;
     }
 
   attr->form = (enum dwarf_form) form;

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list