[openssh-commits] [openssh] 01/02: upstream: Return immediately from get_sock_port

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 31 16:18:02 AEDT 2023


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

dtucker pushed a commit to branch master
in repository openssh.

commit 6f0308a3e717ebe68eeb3f95253612fab5dbf20e
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Fri Mar 31 04:42:29 2023 +0000

    upstream: Return immediately from get_sock_port
    
    if sock <0 so we don't call getsockname on a negative FD.  From Coverity
    CID 291840, ok djm@
    
    OpenBSD-Commit-ID: de1c1130646230c2eda559831fc6bfd1b61d9618
---
 canohost.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/canohost.c b/canohost.c
index 457e9097..28f086e5 100644
--- a/canohost.c
+++ b/canohost.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.c,v 1.76 2023/03/03 05:00:34 djm Exp $ */
+/* $OpenBSD: canohost.c,v 1.77 2023/03/31 04:42:29 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -163,6 +163,8 @@ get_sock_port(int sock, int local)
 	char strport[NI_MAXSERV];
 	int r;
 
+	if (sock < 0)
+		return -1;
 	/* Get IP address of client. */
 	fromlen = sizeof(from);
 	memset(&from, 0, sizeof(from));

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


More information about the openssh-commits mailing list