[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/5] 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@xxxxxxxxxxx>
---
 src/options.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/options.c b/src/options.c
index 791d8cb..2b6d6b4 100644
--- a/src/options.c
+++ b/src/options.c
@@ -1179,7 +1179,8 @@ int ssh_options_getopt(ssh_session session, int *argcptr, char **argv) {
     }
   }
 
-  ssh_options_set(session, SSH_OPTIONS_PORT_STR, port);
+  if (port)
+    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);
-- 
2.1.4


Follow-Ups:
[PATCH 4/5] pki_gcrypt: Rework 'pki_publickey_to_blob'Justus Winter <justus@xxxxxxxxxxx>
[PATCH 3/5] pki_gcrypt: Rework 'pki_key_dup'Justus Winter <justus@xxxxxxxxxxx>
[PATCH 5/5] pki_gcrypt: Rework 'pki_export_pubkey_rsa1'Justus Winter <justus@xxxxxxxxxxx>
[PATCH 2/5] libgcrypt: Add helper to extract MPIs into ssh_stringsJustus Winter <justus@xxxxxxxxxxx>
Re: [PATCH 1/5] options: Check if a port has been givenAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org