public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: asan: segv in _bfd_archive_close_and_cleanup
Date: Wed, 28 Sep 2022 10:27:16 +0930	[thread overview]
Message-ID: <YzOb7A2KDKeUliUT@squeak.grove.modra.org> (raw)

Uninitialised arelt_data->parent_cache led to this segv.

	* pdb.c (pdb_get_elt_at_index): Clear arelt_data.

diff --git a/bfd/pdb.c b/bfd/pdb.c
index 14e1049d03c..5d72797c298 100644
--- a/bfd/pdb.c
+++ b/bfd/pdb.c
@@ -193,7 +193,7 @@ pdb_get_elt_at_index (bfd *abfd, symindex sym_index)
     goto fail;
 
   file->arelt_data =
-    (struct areltdata *) bfd_malloc (sizeof (struct areltdata));
+    (struct areltdata *) bfd_zmalloc (sizeof (struct areltdata));
 
   if (!file->arelt_data)
     goto fail;

-- 
Alan Modra
Australia Development Lab, IBM

                 reply	other threads:[~2022-09-28  0:57 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=YzOb7A2KDKeUliUT@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@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).