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.
This commit is contained in:
Willy Tarreau 2019-01-23 10:39:27 +01:00
parent 1e7d444eec
commit cb923d5001

View File

@ -389,7 +389,12 @@ static int srv_parse_pool_max_conn(char **args, int *cur_arg, struct proxy *curp
memprintf(err, "'%s' expects <value> 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;
}