From: Willy Tarreau Date: Wed, 23 Jan 2019 09:39:27 +0000 (+0100) Subject: MINOR: server: make sure pool-max-conn is >= -1 X-Git-Tag: v2.0-dev1~165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb923d5001e9433f389c35d45cc7b35a7d65e7b6;p=thirdparty%2Fhaproxy.git MINOR: server: make sure pool-max-conn is >= -1 The keyword parser doesn't check the value range, but supported values are -1 and positive values, thus we should check it. This can be backported to 1.9. --- diff --git a/src/server.c b/src/server.c index 7fbe558c5d..5b95e83a0f 100644 --- a/src/server.c +++ b/src/server.c @@ -389,7 +389,12 @@ static int srv_parse_pool_max_conn(char **args, int *cur_arg, struct proxy *curp memprintf(err, "'%s' expects as argument.\n", args[*cur_arg]); return ERR_ALERT | ERR_FATAL; } + newsrv->max_idle_conns = atoi(arg); + if ((int)newsrv->max_idle_conns < -1) { + memprintf(err, "'%s' must be >= -1", args[*cur_arg]); + return ERR_ALERT | ERR_FATAL; + } return 0; }