getsockname on a negative FD. From Coverity CID 291840, ok djm@
-/* $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@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
char strport[NI_MAXSERV];
int r;
+ if (sock < 0)
+ return -1;
/* Get IP address of client. */
fromlen = sizeof(from);
memset(&from, 0, sizeof(from));