From 498a1157279c3dcd5d83d0fcb80eecd7f108d028 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aur=C3=A9lien=20Nephtali?= Date: Fri, 9 Mar 2018 18:51:16 +0100 Subject: [PATCH] BUG/MINOR: cli: Fix a crash when passing a negative or too large value to "show fd" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This bug is present since 7a4a0ac71d ("MINOR: cli: add a new "show fd" command"). This should be backported to 1.8. Signed-off-by: Aurélien Nephtali --- src/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.c b/src/cli.c index fbd264640b..51efbc4458 100644 --- a/src/cli.c +++ b/src/cli.c @@ -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; -- 2.47.3