[binutils-gdb] asan: segv in _bfd_archive_close_and_cleanup

Alan Modra amodra@sourceware.org
Wed Sep 28 00:58:02 GMT 2022


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

commit 540e53422cd8916b85d43060210251132fba8548
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Sep 28 09:22:43 2022 +0930

    asan: segv in _bfd_archive_close_and_cleanup
    
    Uninitialised arelt_data->parent_cache led to this segv.
    
            * pdb.c (pdb_get_elt_at_index): Clear arelt_data.

Diff:
---
 bfd/pdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;


More information about the Binutils-cvs mailing list