diff options
author | Damien Miller <djm@mindrot.org> | 2023-03-31 05:17:22 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2023-03-31 05:17:22 +0200 |
commit | a4c1c2513e36f111eeaa1322c510067930e5e51e (patch) | |
tree | a0045e9897ac7439ffe0cf77b05101a3cba8f5d5 /channels.c | |
parent | upstream: return SSH_ERR_KEY_NOT_FOUND if the allowed_signers file (diff) | |
download | openssh-a4c1c2513e36f111eeaa1322c510067930e5e51e.tar.xz openssh-a4c1c2513e36f111eeaa1322c510067930e5e51e.zip |
don't call connect() on negative socket
Coverity CID 405037
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels.c b/channels.c index d9f59f466..ffaf89720 100644 --- a/channels.c +++ b/channels.c @@ -5045,8 +5045,10 @@ connect_local_xsocket_path(const char *pathname) struct sockaddr_un addr; sock = socket(AF_UNIX, SOCK_STREAM, 0); - if (sock == -1) + if (sock == -1) { error("socket: %.100s", strerror(errno)); + return -1; + } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strlcpy(addr.sun_path, pathname, sizeof addr.sun_path); |