summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2015-11-19 08:23:27 +0000
committerdjm <djm@openbsd.org>2015-11-19 08:23:27 +0000
commit1f72f772b8a09130d07e911a1a3d9a82730ff14b (patch)
treef1031aa43494164fe4e948656272f9c8cf8952ba /usr.bin/ssh/ssh.c
parentRemove cscope support in vi. (diff)
downloadwireguard-openbsd-1f72f772b8a09130d07e911a1a3d9a82730ff14b.tar.xz
wireguard-openbsd-1f72f772b8a09130d07e911a1a3d9a82730ff14b.zip
ban ConnectionAttempts=0, it makes no sense and would cause
ssh_connect_direct() to print an uninitialised stack variable; bz#2500 reported by dvw AT phas.ubc.ca
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r--usr.bin/ssh/ssh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 7021bc54a3d..ce7222a696b 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.429 2015/10/25 23:42:00 dtucker Exp $ */
+/* $OpenBSD: ssh.c,v 1.430 2015/11/19 08:23:27 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1066,6 +1066,9 @@ main(int ac, char **av)
"disabling");
options.update_hostkeys = 0;
}
+ if (options.connection_attempts <= 0)
+ fatal("Invalid number of ConnectionAttempts");
+
if (original_effective_uid != 0)
options.use_privileged_port = 0;