aboutsummaryrefslogtreecommitdiffstats
path: root/tools/debugger
diff options
context:
space:
mode:
authorMatthew Daley <mattjd@gmail.com>2013-09-18 15:38:04 +1200
committerIan Campbell <ian.campbell@citrix.com>2013-09-21 16:43:13 +0100
commit6c1bfef44580d73943bd9453167e5614db13927f (patch)
treec27ed2c27d27b45821a0e7a27b8a58d1d25b5380 /tools/debugger
parent6ea48409238672ed1e08cf8fa2cc8593e36a363a (diff)
downloadxen-6c1bfef44580d73943bd9453167e5614db13927f.tar.gz
xen-6c1bfef44580d73943bd9453167e5614db13927f.tar.bz2
xen-6c1bfef44580d73943bd9453167e5614db13927f.zip
gdbsx: clear sockaddr before using it
...so that sin_zero is actually zero. Coverity-ID: 1056070 Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/debugger')
-rw-r--r--tools/debugger/gdbsx/gx/gx_comm.c1
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 ed4a7bef0e..7680dbd0d7 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;