[PATCH 5/5] Ensure no garbage left in msghdr for sendmsg call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 exec/totemudp.c  |    2 ++
 exec/totemudpu.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/exec/totemudp.c b/exec/totemudp.c
index de2d467..371746d 100644
--- a/exec/totemudp.c
+++ b/exec/totemudp.c
@@ -280,6 +280,7 @@ static inline void ucast_sendmsg (
 	/*
 	 * Build unicast message
 	 */
+	memset(&msg_ucast, 0, sizeof(msg_ucast));
 	totemip_totemip_to_sockaddr_convert(system_to,
 		instance->totem_interface->ip_port, &sockaddr, &addrlen);
 	msg_ucast.msg_name = &sockaddr;
@@ -349,6 +350,7 @@ static inline void mcast_sendmsg (
 	 */
 	totemip_totemip_to_sockaddr_convert(&instance->mcast_address,
 		instance->totem_interface->ip_port, &sockaddr, &addrlen);
+	memset(&msg_mcast, 0, sizeof(msg_mcast));
 	msg_mcast.msg_name = &sockaddr;
 	msg_mcast.msg_namelen = addrlen;
 	msg_mcast.msg_iov = (void *)&iovec;
diff --git a/exec/totemudpu.c b/exec/totemudpu.c
index bcbf390..ed3fa60 100644
--- a/exec/totemudpu.c
+++ b/exec/totemudpu.c
@@ -277,6 +277,7 @@ static inline void ucast_sendmsg (
 	 */
 	totemip_totemip_to_sockaddr_convert(system_to,
 		instance->totem_interface->ip_port, &sockaddr, &addrlen);
+	memset(&msg_ucast, 0, sizeof(msg_ucast));
 	msg_ucast.msg_name = &sockaddr;
 	msg_ucast.msg_namelen = addrlen;
 	msg_ucast.msg_iov = (void *)&iovec;
@@ -340,6 +341,7 @@ static inline void mcast_sendmsg (
 	iovec.iov_base = (void *)buf_out;
 	iovec.iov_len = buf_out_len;
 
+	memset(&msg_mcast, 0, sizeof(msg_mcast));
 	/*
 	 * Build multicast message
 	 */
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux