mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-30 09:14:59 +02:00
upstream: guard against getsockname(-1, ...) from Coverity CID
291832 OpenBSD-Commit-ID: e58d5227327917d189229b7f0b37d2780f360d5f
This commit is contained in:
parent
78571a5fe9
commit
1842d523fa
@ -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>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* 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];
|
char ntop[NI_MAXHOST];
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (sock < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Get IP address of client. */
|
/* Get IP address of client. */
|
||||||
addrlen = sizeof(addr);
|
addrlen = sizeof(addr);
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user