[openssh-commits] [openssh] 02/05: upstream: Check fd against >=0 instead of >0 in error path. The

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 31 15:06:29 AEDT 2023


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

djm pushed a commit to branch master
in repository openssh.

commit 0eb8131e4a53b33a8fc9b9ab694e6b6778b87ade
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Fri Mar 31 00:44:29 2023 +0000

    upstream: Check fd against >=0 instead of >0 in error path. The
    
    dup could in theory return fd 0 although currently it doesn't in practice.
    From Dmitry Belyavskiy vi github PR#238.
    
    OpenBSD-Commit-ID: 4a95f3f7330394dffee5c749d52713cbf3b54846
---
 monitor_wrap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/monitor_wrap.c b/monitor_wrap.c
index 27517116..3533cf06 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.127 2023/03/30 00:49:37 dtucker Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.128 2023/03/31 00:44:29 dtucker Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos at citi.umich.edu>
  * Copyright 2002 Markus Friedl <markus at openbsd.org>
@@ -575,7 +575,7 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
 	if ((tmp1 = dup(pmonitor->m_recvfd)) == -1 ||
 	    (tmp2 = dup(pmonitor->m_recvfd)) == -1) {
 		error_f("cannot allocate fds for pty");
-		if (tmp1 > 0)
+		if (tmp1 >= 0)
 			close(tmp1);
 		return 0;
 	}

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


More information about the openssh-commits mailing list