summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2001-04-12 20:09:39 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2001-04-12 20:09:39 +0000
commite57cfb6e67a9083afbbf8ef90cc40f20f3cc0cae (patch)
tree9c6a40aa55acc3e7cd847d65b01b96fc26a1ad9a /usr.bin/ssh/sshd.c
parent16b07b0d75cefdf012d4d5121c56a888154ae47d (diff)
robust port validation; ok markus@ jakob@
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 15bdffcf377..661678c2837 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -40,7 +40,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.192 2001/04/11 16:25:30 lebel Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.193 2001/04/12 20:09:38 stevesk Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -598,7 +598,11 @@ main(int ac, char **av)
fprintf(stderr, "too many ports.\n");
exit(1);
}
- options.ports[options.num_ports++] = atoi(optarg);
+ options.ports[options.num_ports++] = a2port(optarg);
+ if (options.ports[options.num_ports-1] == 0) {
+ fprintf(stderr, "Bad port number.\n");
+ exit(1);
+ }
break;
case 'g':
options.login_grace_time = atoi(optarg);