[openssh-commits] [openssh] 01/01: Increment nfds when coming from startup_pipe.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Sep 8 18:45:02 AEST 2021


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch V_8_7
in repository openssh.

commit 7e6bd78999853f09ba8fb2dcf73f84a27f4043af
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Wed Sep 8 18:39:44 2021 +1000

    Increment nfds when coming from startup_pipe.
    
    If we have to increase nfds because startup_pipe[0] is above any of the
    descriptors passed in the fd_sets, we also need to add 1 to nfds since
    select takes highest FD number plus one.  bz#3345 from yaroslav.kuzmin
    at vmssoftware.com.
---
 openbsd-compat/bsd-pselect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openbsd-compat/bsd-pselect.c b/openbsd-compat/bsd-pselect.c
index fff1bf54..b3632086 100644
--- a/openbsd-compat/bsd-pselect.c
+++ b/openbsd-compat/bsd-pselect.c
@@ -188,7 +188,7 @@ pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
 	if (unmasked) {
 		pselect_notify_setup();
 		pselect_notify_prepare(readfds);
-		nfds = MAX(nfds, notify_pipe[0]);
+		nfds = MAX(nfds, notify_pipe[0] + 1);
 	}
 
 	/* Unmask signals, call select then restore signal mask. */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list