diff --git a/include/types/applet.h b/include/types/applet.h index 82e478174..672f9db28 100644 --- a/include/types/applet.h +++ b/include/types/applet.h @@ -93,6 +93,8 @@ struct appctx { struct { const char *msg; /* pointer to a persistent message to be returned in CLI_ST_PRINT state */ char *err; /* pointer to a 'must free' message to be returned in CLI_ST_PRINT_FREE state */ + void *p0, *p1; /* general purpose pointers and integers for registered commands, initialized */ + int i0, i1; /* to 0 by the CLI before first invocation of the keyword parser. */ } cli; /* context used by the CLI */ /* all entries below are used by various CLI commands, please diff --git a/src/cli.c b/src/cli.c index 82c1bf759..adb2dd604 100644 --- a/src/cli.c +++ b/src/cli.c @@ -455,6 +455,7 @@ static int cli_parse_request(struct appctx *appctx, char *line) } appctx->st2 = 0; + memset(&appctx->ctx.cli, 0, sizeof(appctx->ctx.cli)); kw = cli_find_kw(args); if (!kw)