artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c3c37d
)
guard against getsockname(-1, ...) from Coverity CID 291832
author
djm
<djm@openbsd.org>
Fri, 3 Mar 2023 05:00:34 +0000
(
05:00
+0000)
committer
djm
<djm@openbsd.org>
Fri, 3 Mar 2023 05:00:34 +0000
(
05:00
+0000)
usr.bin/ssh/canohost.c
patch
|
blob
|
history
diff --git
a/usr.bin/ssh/canohost.c
b/usr.bin/ssh/canohost.c
index
406c5fd
..
3a73056
100644
(file)
--- a/
usr.bin/ssh/canohost.c
+++ b/
usr.bin/ssh/canohost.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: canohost.c,v 1.7
5 2020/10/18 11:32:01
djm Exp $ */
+/* $OpenBSD: canohost.c,v 1.7
6 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
@@
-44,6
+44,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));