mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 05:41:26 +02:00
CLEANUP: vars: always pre-initialize smp in vars_parse_cli_get_var()
In issue #1200 Coverity believes we may use an uninitialized field smp.sess here while it's not possible because the returned variable necessarily matches SCOPE_PROC hence smp.sess is not used. But it cannot see this and it could be confusing if the code later evolved into something more complex. That's not a critical path so let's first reset the sample.
This commit is contained in:
parent
09f88364b7
commit
374edc70ba
@ -873,7 +873,7 @@ static int vars_parse_global_set_var(char **args, int section_type, struct proxy
|
|||||||
static int vars_parse_cli_get_var(char **args, char *payload, struct appctx *appctx, void *private)
|
static int vars_parse_cli_get_var(char **args, char *payload, struct appctx *appctx, void *private)
|
||||||
{
|
{
|
||||||
struct vars *vars;
|
struct vars *vars;
|
||||||
struct sample smp;
|
struct sample smp = { };
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!cli_has_level(appctx, ACCESS_LVL_OPER))
|
if (!cli_has_level(appctx, ACCESS_LVL_OPER))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user