From: Willy Tarreau Date: Tue, 3 May 2022 15:02:03 +0000 (+0200) Subject: CLEANUP: cli: initialize the whole appctx->ctx, not just the stats part X-Git-Tag: v2.6-dev9~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf20caacca1030ca4b8d36e8e44ec5bdce5088f;p=thirdparty%2Fhaproxy.git CLEANUP: cli: initialize the whole appctx->ctx, not just the stats part Historically the CLI was a second access to the stats and we've continued to initialize only the stats part when initializing the CLI. Let's make sure we do that on the whole ctx instead. It's probably not more needed at all nowadays but better stay on the safe side. --- diff --git a/src/cli.c b/src/cli.c index cfbecf14d7..7bc579adc4 100644 --- a/src/cli.c +++ b/src/cli.c @@ -902,8 +902,8 @@ static void cli_io_handler(struct appctx *appctx) while (1) { if (appctx->st0 == CLI_ST_INIT) { - /* Stats output not initialized yet */ - memset(&appctx->ctx.stats, 0, sizeof(appctx->ctx.stats)); + /* CLI/stats not initialized yet */ + memset(&appctx->ctx, 0, sizeof(appctx->ctx)); /* reset severity to default at init */ appctx->cli_severity_output = bind_conf->severity_output; appctx->st0 = CLI_ST_GETREQ;