updateconninfo: clear destination struct before getsockname()

Otherwise we may read uninitialized bytes later in the unix-domain
sockets case.
This commit is contained in:
Daniel Stenberg 2014-12-04 02:46:15 +01:00
parent 7853c1cfe6
commit 9730c9fb70
1 changed files with 1 additions and 0 deletions

View File

@ -679,6 +679,7 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
}
len = sizeof(struct Curl_sockaddr_storage);
memset(&ssloc, 0, sizeof(ssloc));
if(getsockname(sockfd, (struct sockaddr*) &ssloc, &len)) {
error = SOCKERRNO;
failf(data, "getsockname() failed with errno %d: %s",