Chalk up another phkmalloc victim.
It seems as if uninitialised memory was the culprit. We may want to contribute this back to the OpenSSH project. Submitted by: Alexander Leidinger <Alexander@Leidinger.net> on -current.
This commit is contained in:
parent
c0c2363472
commit
5209950187
@ -33,7 +33,7 @@ int
|
||||
ssh_get_authentication_socket()
|
||||
{
|
||||
const char *authsocket;
|
||||
int sock;
|
||||
int sock, len;
|
||||
struct sockaddr_un sunaddr;
|
||||
|
||||
authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME);
|
||||
@ -42,6 +42,7 @@ ssh_get_authentication_socket()
|
||||
|
||||
sunaddr.sun_family = AF_UNIX;
|
||||
strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path));
|
||||
sunaddr.sun_len = len = SUN_LEN(&sunaddr)+1;
|
||||
|
||||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0)
|
||||
@ -52,7 +53,7 @@ ssh_get_authentication_socket()
|
||||
close(sock);
|
||||
return -1;
|
||||
}
|
||||
if (connect(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) {
|
||||
if (connect(sock, (struct sockaddr *) & sunaddr, len) < 0) {
|
||||
close(sock);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user