[Patch] mach-o: clear allocated target data

Tristan Gingold gingold@adacore.com
Thu Dec 5 10:18:00 GMT 2013


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;



More information about the Binutils mailing list