From: Aurélien Nephtali Date: Fri, 16 Mar 2018 09:11:06 +0000 (+0100) Subject: BUG/MINOR: cli: Fix a crash when sending a command with too many arguments X-Git-Tag: v1.9-dev1~368 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a61e968ac43345ecc7d53b1ccaea77fdb5ad042;p=thirdparty%2Fhaproxy.git BUG/MINOR: cli: Fix a crash when sending a command with too many arguments 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 --- diff --git a/src/cli.c b/src/cli.c index 7bffbdd56f..ada45a8656 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] == '\\') {