public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* asan: segv in _bfd_archive_close_and_cleanup
@ 2022-09-28  0:57 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-09-28  0:57 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-28  0:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  0:57 asan: segv in _bfd_archive_close_and_cleanup Alan Modra

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).