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>
This commit is contained in:
Matthew Daley authored and Ian Campbell committed 2013-09-21 16:43:13 +01:00
1 parent 6ea4840923
commit 6c1bfef445
1 file changed
+1
+1
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.