This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch] mach-o: clear allocated target data
- From: Tristan Gingold <gingold at adacore dot com>
- To: "binutils at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Thu, 5 Dec 2013 11:18:39 +0100
- Subject: [Patch] mach-o: clear allocated target data
- Authentication-results: sourceware.org; auth=none
Hi,
this patch fixes possible uninitialized memory in the mach-o back-end:
the target data are now allocated by bfd_zalloc instead of bfd_alloc.
Committed on trunk.
Tristan.
bfd/
2013-12-05 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_mkobject_init): Use bfd_zalloc.
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -4148,7 +4148,7 @@ bfd_mach_o_mkobject_init (bfd *abfd)
{
bfd_mach_o_data_struct *mdata = NULL;
- mdata = bfd_alloc (abfd, sizeof (bfd_mach_o_data_struct));
+ mdata = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct));
if (mdata == NULL)
return FALSE;
abfd->tdata.mach_o_data = mdata;