From 54b3d3ea4ebb280d6cb7587e19a830576977fbb9 Mon Sep 17 00:00:00 2001 From: dtucker Date: Mon, 7 Nov 2022 10:02:59 +0000 Subject: [PATCH] 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@ --- usr.bin/ssh/servconf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 07c54770008..9822ff33073 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/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 , Espoo, Finland * All rights reserved @@ -1861,6 +1861,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: -- 2.20.1