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

[Xen-devel] [PATCH 28/32] net: initialize parameters before use in net_socket_fd_init_dgram()



From: Yunlei Ding <yunlei.ding@xxxxxxxxxx>

Signed-off-by: Yunlei Ding <yunlei.ding@xxxxxxxxxx>
Coverity-IDs: 1005339 1005340
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 net.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net.c b/net.c
index 33460d8..8aba3c2 100644
--- a/net.c
+++ b/net.c
@@ -1316,9 +1316,11 @@ static NetSocketState 
*net_socket_fd_init_dgram(VLANState *vlan,
 {
     struct sockaddr_in saddr;
     int newfd;
-    socklen_t saddr_len;
+    socklen_t saddr_len = sizeof(saddr);
     NetSocketState *s;
 
+    memset(&saddr, 0, sizeof(saddr));
+
     /* fd passed: multicast: "learn" dgram_dst address from bound address and 
save it
      * Because this may be "shared" socket from a "master" process, datagrams 
would be recv()
      * by ONLY ONE process: we must "clone" this dgram socket --jjo
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.