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

[Xen-changelog] [xen master] gdbsx: clear sockaddr before using it



commit 6c1bfef44580d73943bd9453167e5614db13927f
Author:     Matthew Daley <mattjd@xxxxxxxxx>
AuthorDate: Wed Sep 18 15:38:04 2013 +1200
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Sat Sep 21 16:43:13 2013 +0100

    gdbsx: clear sockaddr before using it
    
    ...so that sin_zero is actually zero.
    
    Coverity-ID: 1056070
    Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/debugger/gdbsx/gx/gx_comm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/debugger/gdbsx/gx/gx_comm.c 
b/tools/debugger/gdbsx/gx/gx_comm.c
index ed4a7be..7680dbd 100644
--- a/tools/debugger/gdbsx/gx/gx_comm.c
+++ b/tools/debugger/gdbsx/gx/gx_comm.c
@@ -84,6 +84,7 @@ do_tcp(char *port_str)
     tmp = 1;
     setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, (char *)&tmp,sizeof(tmp));
 
+    memset(&sockaddr, 0, sizeof(sockaddr));
     sockaddr.sin_family = PF_INET;
     sockaddr.sin_port = htons (port);
     sockaddr.sin_addr.s_addr = INADDR_ANY;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
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®.