From 9730c9fb7075792a112b65a023379fad3ec8dda4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Dec 2014 02:46:15 +0100 Subject: [PATCH] updateconninfo: clear destination struct before getsockname() Otherwise we may read uninitialized bytes later in the unix-domain sockets case. --- lib/connect.c | 1 + 1 file changed, 1 insertion(+) 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",