=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/canohost.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- src/usr.bin/ssh/canohost.c 2020/10/18 11:32:01 1.75 +++ src/usr.bin/ssh/canohost.c 2023/03/03 05:00:34 1.76 @@ -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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -43,6 +43,9 @@ socklen_t addrlen; char ntop[NI_MAXHOST]; int r; + + if (sock < 0) + return NULL; /* Get IP address of client. */ addrlen = sizeof(addr);