summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2022-11-07 10:02:59 +0000
committerDarren Tucker <dtucker@dtucker.net>2022-11-07 22:22:06 +1100
commit1d78d25653805aefc7a8dd9d86cd7359ada3823c (patch)
tree1a080a766c531800fb9bc891117b1b6c9cdd52aa /servconf.c
parenta00f59a645072e5f5a8d207af15916a7b23e2642 (diff)
downloadopenssh-git-1d78d25653805aefc7a8dd9d86cd7359ada3823c.tar.gz
upstream: Check for and disallow MaxStartups values less than or
equal to zero during config parsing, rather than faling later at runtime. bz#3489, ok djm@ OpenBSD-Commit-ID: d79c2b7a8601eb9be493629a91245d761154308b
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c
index 423772b1..bba3ad80 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: servconf.c,v 1.386 2022/09/17 10:34:29 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.387 2022/11/07 10:02:59 dtucker Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1918,6 +1918,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
filename, linenum, keyword);
else
options->max_startups = options->max_startups_begin;
+ if (options->max_startups <= 0 ||
+ options->max_startups_begin <= 0)
+ fatal("%s line %d: Invalid %s spec.",
+ filename, linenum, keyword);
break;
case sPerSourceNetBlockSize: