Skip to content

Commit d209849

Browse files
committed
Prevent theoretical NULL deref in throughlocal_sftp.
Coverity CID 405019, although at the moment it's not reachable. ok djm@
1 parent e66156e commit d209849

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

usr.bin/ssh/scp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: scp.c,v 1.261 2024/06/26 23:14:14 deraadt Exp $ */
1+
/* $OpenBSD: scp.c,v 1.262 2025/03/19 06:11:15 dtucker Exp $ */
22
/*
33
* scp - secure remote copy. This is basically patched BSD rcp which
44
* uses ssh to do the data transfer (instead of using rcmd).
@@ -1024,7 +1024,7 @@ toremote(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
10241024
}
10251025
if (host && throughlocal) { /* extended remote to remote */
10261026
if (mode == MODE_SFTP) {
1027-
if (remin == -1) {
1027+
if (remin == -1 || conn == NULL) {
10281028
/* Connect to dest now */
10291029
conn = do_sftp_connect(thost, tuser,
10301030
tport, sftp_direct,

0 commit comments

Comments
 (0)