mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
options: Check if a port has been given
* src/options.c (ssh_options_getopt): Only call 'ssh_options_set' if a port has been given. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
bbd0522026
commit
fea9e3050c
@@ -1179,7 +1179,9 @@ int ssh_options_getopt(ssh_session session, int *argcptr, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
ssh_options_set(session, SSH_OPTIONS_PORT_STR, port);
|
||||
if (port != NULL) {
|
||||
ssh_options_set(session, SSH_OPTIONS_PORT_STR, port);
|
||||
}
|
||||
|
||||
ssh_options_set(session, SSH_OPTIONS_SSH1, &ssh1);
|
||||
ssh_options_set(session, SSH_OPTIONS_SSH2, &ssh2);
|
||||
|
||||
Reference in New Issue
Block a user