BUG/MINOR: cli: Fix a crash when passing a negative or too large value to "show fd"

This bug is present since 7a4a0ac71d ("MINOR: cli: add a new "show fd"
command").

This should be backported to 1.8.

Signed-off-by: Aurlien Nephtali <aurelien.nephtali@corp.ovh.com>
This commit is contained in:
Aurlien Nephtali 2018-03-09 18:51:16 +01:00 committed by Willy Tarreau
parent 84b118f312
commit 498a115727

View File

@ -772,7 +772,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
/* we have two inner loops here, one for the proxy, the other one for
* the buffer.
*/
while (fd < global.maxsock) {
while (fd >= 0 && fd < global.maxsock) {
struct fdtab fdt;
struct listener *li = NULL;
struct server *sv = NULL;