[openssh-commits] [openssh] 02/02: Clear notify_pipe from readset if present.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jun 4 23:42:33 AEST 2021


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

dtucker pushed a commit to branch master
in repository openssh.

commit aa99b2d9a3e45b943196914e8d8bf086646fdb54
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Jun 4 23:41:29 2021 +1000

    Clear notify_pipe from readset if present.
    
    Prevents leaking an implementation detail to the caller.
---
 openbsd-compat/bsd-pselect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/openbsd-compat/bsd-pselect.c b/openbsd-compat/bsd-pselect.c
index 2cda0b58..da34b41d 100644
--- a/openbsd-compat/bsd-pselect.c
+++ b/openbsd-compat/bsd-pselect.c
@@ -114,9 +114,11 @@ notify_done(fd_set *readset)
 {
 	char c;
 
-	if (notify_pipe[0] != -1 && FD_ISSET(notify_pipe[0], readset))
+	if (notify_pipe[0] != -1 && FD_ISSET(notify_pipe[0], readset)) {
 		while (read(notify_pipe[0], &c, 1) != -1)
 			debug2_f("reading");
+		FD_CLR(notify_pipe[0], readset);
+	}
 }
 
 /*ARGSUSED*/

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


More information about the openssh-commits mailing list