summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ssh.c16
2 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d105cbe0..2260bb307 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
12 - djm@cvs.openbsd.org 2001/04/11 07:06:22 12 - djm@cvs.openbsd.org 2001/04/11 07:06:22
13 [sftp-int.c] 13 [sftp-int.c]
14 'mget' and 'mput' aliases; ok markus@ 14 'mget' and 'mput' aliases; ok markus@
15 - markus@cvs.openbsd.org 2001/04/11 10:59:01
16 [ssh.c]
17 use strtol() for ports, thanks jakob@
15 18
1620010410 1920010410
17 - OpenBSD CVS Sync 20 - OpenBSD CVS Sync
@@ -5005,4 +5008,4 @@
5005 - Wrote replacements for strlcpy and mkdtemp 5008 - Wrote replacements for strlcpy and mkdtemp
5006 - Released 1.0pre1 5009 - Released 1.0pre1
5007 5010
5008$Id: ChangeLog,v 1.1097 2001/04/11 23:05:17 mouring Exp $ 5011$Id: ChangeLog,v 1.1098 2001/04/11 23:06:28 mouring Exp $
diff --git a/ssh.c b/ssh.c
index 75094a106..89ced97e2 100644
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: ssh.c,v 1.108 2001/04/07 08:55:18 markus Exp $"); 42RCSID("$OpenBSD: ssh.c,v 1.109 2001/04/11 10:59:01 markus Exp $");
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45#include <openssl/err.h> 45#include <openssl/err.h>
@@ -243,7 +243,7 @@ main(int ac, char **av)
243{ 243{
244 int i, opt, optind, exit_status, ok; 244 int i, opt, optind, exit_status, ok;
245 u_short fwd_port, fwd_host_port; 245 u_short fwd_port, fwd_host_port;
246 char *optarg, *cp, buf[256]; 246 char *optarg, *cp, *endofnumber, buf[256];
247 struct stat st; 247 struct stat st;
248 struct passwd *pw; 248 struct passwd *pw;
249 int dummy; 249 int dummy;
@@ -456,7 +456,11 @@ main(int ac, char **av)
456 } 456 }
457 break; 457 break;
458 case 'p': 458 case 'p':
459 options.port = atoi(optarg); 459 options.port = strtol(optarg, &endofnumber, 0);
460 if (optarg == endofnumber) {
461 fprintf(stderr, "Bad port '%s'\n", optarg);
462 exit(1);
463 }
460 break; 464 break;
461 case 'l': 465 case 'l':
462 options.user = optarg; 466 options.user = optarg;
@@ -485,7 +489,11 @@ main(int ac, char **av)
485 break; 489 break;
486 490
487 case 'D': 491 case 'D':
488 fwd_port = atoi(optarg); 492 fwd_port = strtol(optarg, &endofnumber, 0);
493 if (optarg == endofnumber) {
494 fprintf(stderr, "Bad port '%s'\n", optarg);
495 exit(1);
496 }
489 add_local_forward(&options, fwd_port, "socks4", 0); 497 add_local_forward(&options, fwd_port, "socks4", 0);
490 break; 498 break;
491 499