aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-12-04 02:46:15 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-12-04 02:52:19 +0100
commit9730c9fb7075792a112b65a023379fad3ec8dda4 (patch)
treee28ad5b3eb42081a9a885e0da9e9a5e9f2104ce2 /lib
parent7853c1cfe6fc7828afbb812791a383781aca3be3 (diff)
updateconninfo: clear destination struct before getsockname()
Otherwise we may read uninitialized bytes later in the unix-domain sockets case.
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 25d2103f4..b3a96ce83 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -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",