From 4a56bb2033a88767445c20fe2df5da3dc331f18f Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Thu, 11 Nov 2010 00:29:19 +0000 Subject: [PATCH] Zero the buffer containing the .gnu_debuglink section before writing into it. Prior to this commit the .gnu_debuglink section can have up to 3 bytes of uninitialized garbage; as a result, .ko files could change vary between builds. Approved by: dim MFC after: 7 days --- contrib/binutils/bfd/opncls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c index 6abd40509ca2..ac025e5f9c81 100644 --- a/contrib/binutils/bfd/opncls.c +++ b/contrib/binutils/bfd/opncls.c @@ -1151,7 +1151,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *abfd, debuglink_size &= ~3; debuglink_size += 4; - contents = malloc (debuglink_size); + contents = bfd_zmalloc (debuglink_size); if (contents == NULL) { /* XXX Should we delete the section from the bfd ? */