initialise salen in binresvport_sa

avoids failures with UsePrivilegedPort=yes

patch from Juan Gallego
This commit is contained in:
Damien Miller 2016-05-10 09:51:06 +10:00
parent c5c1d5d2f0
commit 332ff3d770
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ bindresvport_sa(int sd, struct sockaddr *sa)
if (sa == NULL) {
memset(&myaddr, 0, sizeof(myaddr));
sa = (struct sockaddr *)&myaddr;
salen = sizeof(myaddr);
if (getsockname(sd, sa, &salen) == -1)
return -1; /* errno is correctly set */