public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] objdump use of uninitialised value in pr_string_field
Date: Tue, 18 Apr 2023 01:50:18 +0000 (GMT)	[thread overview]
Message-ID: <20230418015018.2484B385840F@sourceware.org> (raw)

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:

                 reply	other threads:[~2023-04-18  1:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230418015018.2484B385840F@sourceware.org \
    --to=amodra@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).