From: Alan Modra Date: Thu, 9 Dec 2021 21:57:58 +0000 (+1030) Subject: PR28674, objdump crash X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b243230f64fb4db9a16ef88ec5bd3e3f48f1fe41;p=binutils-gdb.git PR28674, objdump crash 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;