[binutils-gdb] objdump use of uninitialised value in pr_string_field

Alan Modra amodra@sourceware.org
Tue Apr 18 01:50:18 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=341eba4f9d4f39c8bd08ff59120662e86a3de305

commit 341eba4f9d4f39c8bd08ff59120662e86a3de305
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Apr 18 10:22:08 2023 +0930

    objdump use of uninitialised value in pr_string_field
    
            PR 30365
            * rdcoff.c (parse_coff_struct_type): Leave bitsize zero when no
            auxents.

Diff:
---
 binutils/rdcoff.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/binutils/rdcoff.c b/binutils/rdcoff.c
index 17e89e87d74..79fcfb21814 100644
--- a/binutils/rdcoff.c
+++ b/binutils/rdcoff.c
@@ -385,7 +385,8 @@ parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols,
 
 	case C_FIELD:
 	  bitpos = bfd_asymbol_value (sym);
-	  bitsize = auxent.x_sym.x_misc.x_lnsz.x_size;
+	  if (psubaux != NULL)
+	    bitsize = psubaux->x_sym.x_misc.x_lnsz.x_size;
 	  break;
 
 	case C_EOS:


More information about the Binutils-cvs mailing list