]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: cli: initialize the whole appctx->ctx, not just the stats part
authorWilly Tarreau <w@1wt.eu>
Tue, 3 May 2022 15:02:03 +0000 (17:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 May 2022 16:13:35 +0000 (18:13 +0200)
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.

src/cli.c

index cfbecf14d7a8424cc387e87cc72db16d85c3be2e..7bc579adc4d4885e891adfa6b65db2d3bf329301 100644 (file)
--- 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;