Package: lilypond / 2.19.83-1~exp1

0005-Don-t-access-uninitialised-memory-in-scm_to_sockaddr.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 0ed896b3f6c9f9d731fd7cfb0d121d2fbb807be8 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@debian.org>
Date: Wed, 27 Apr 2011 12:35:58 +0000
Subject: Don't access uninitialised memory in scm_to_sockaddr().

Signed-off-by: Thorsten Glaser <tg@debian.org>
---
 libguile/socket.c | 7 +++++++
 1 file changed, 7 insertions(+)

--- a/guile18/libguile/socket.c
+++ b/guile18/libguile/socket.c
@@ -1143,6 +1143,13 @@
 	  {
 	    struct sockaddr_in c_inet;
 
+	    /*
+	     * initialise the entire struct, including all
+	     * possible padding, to NUL to avoid copying
+	     * uninitialised memory in the memcpy below
+	     */
+	    memset (&c_inet, 0, sizeof (c_inet));
+
 	    c_inet.sin_addr.s_addr =
 	      htonl (scm_to_ulong (SCM_SIMPLE_VECTOR_REF (address, 1)));
 	    c_inet.sin_port =