From 6a61e968ac43345ecc7d53b1ccaea77fdb5ad042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Nephtali?= Date: Fri, 16 Mar 2018 10:11:06 +0100 Subject: [PATCH] BUG/MINOR: cli: Fix a crash when sending a command with too many arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This bug was introduced in 48bcfdab2 ("MEDIUM: dumpstat: make the CLI parser understand the backslash as an escape char"). 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 7bffbdd56..ada45a865 100644 --- a/src/cli.c +++ b/src/cli.c @@ -416,7 +416,7 @@ static int cli_parse_request(struct appctx *appctx, char *line) /* unescape '\' */ arg = 0; - while (*args[arg] != '\0') { + while (arg <= MAX_STATS_ARGS && *args[arg] != '\0') { j = 0; for (i=0; args[arg][i] != '\0'; i++) { if (args[arg][i] == '\\') {