From b243230f64fb4db9a16ef88ec5bd3e3f48f1fe41 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 10 Dec 2021 08:27:58 +1030 Subject: [PATCH] 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. --- bfd/dwarf2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2