From 332ff3d770631e7513fea38cf0d3689f673f0e3f Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 10 May 2016 09:51:06 +1000 Subject: [PATCH] initialise salen in binresvport_sa avoids failures with UsePrivilegedPort=yes patch from Juan Gallego --- openbsd-compat/bindresvport.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index c89f21403..eeb269d59 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c @@ -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 */