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

[Xen-changelog] [qemu-xen-traditional stable-4.6] net: initialize parameters before use in net_socket_fd_init_dgram()



commit 9da9f80538c8ff891886cfe3d987ca17bd240d19
Author:     Yunlei Ding <yunlei.ding@xxxxxxxxxx>
AuthorDate: Tue Mar 11 09:55:59 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    net: initialize parameters before use in net_socket_fd_init_dgram()
    
    Signed-off-by: Yunlei Ding <yunlei.ding@xxxxxxxxxx>
    Coverity-IDs: 1005339 1005340
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 net.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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
--
generated by git-patchbot for /home/xen/git/qemu-xen-traditional.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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