diff options
Diffstat (limited to 'crypto/openssh/canohost.c')
-rw-r--r-- | crypto/openssh/canohost.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/openssh/canohost.c b/crypto/openssh/canohost.c index a810da0eeb73..457e9097e159 100644 --- a/crypto/openssh/canohost.c +++ b/crypto/openssh/canohost.c @@ -1,4 +1,4 @@ -/* $OpenBSD: canohost.c,v 1.75 2020/10/18 11:32:01 djm Exp $ */ +/* $OpenBSD: canohost.c,v 1.76 2023/03/03 05:00:34 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -72,6 +72,9 @@ get_socket_address(int sock, int remote, int flags) char ntop[NI_MAXHOST]; int r; + if (sock < 0) + return NULL; + /* Get IP address of client. */ addrlen = sizeof(addr); memset(&addr, 0, sizeof(addr)); |