]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
initialise salen in binresvport_sa
authorDamien Miller <djm@mindrot.org>
Mon, 9 May 2016 23:51:06 +0000 (09:51 +1000)
committerDamien Miller <djm@mindrot.org>
Mon, 9 May 2016 23:51:06 +0000 (09:51 +1000)
avoids failures with UsePrivilegedPort=yes

patch from Juan Gallego

openbsd-compat/bindresvport.c

index c89f2140344573552109e4bdcf6413cfc51ed9c9..eeb269d59dfcfed2b70544b549521bd1577addc6 100644 (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 */