Commit 9730c9fb authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

updateconninfo: clear destination struct before getsockname()

Otherwise we may read uninitialized bytes later in the unix-domain
sockets case.
parent 7853c1cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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",