From: Willy Tarreau Date: Tue, 28 Apr 2026 01:24:07 +0000 (+0200) Subject: BUG/MINOR: vars: make parse_store() return error on var_set() failure X-Git-Tag: v3.4-dev11~96 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=2b30330cdcce4b3fd3648b480b0063ab167df054;p=haproxy.git BUG/MINOR: vars: make parse_store() return error on var_set() failure In 2.5, variables in the scope "proc" were pre-created with commit df8eeb1619 ("MEDIUM: vars: pre-create parsed SCOPE_PROC variables as permanent ones"). However one test on var_set() was copy-pasted from vars_check_args() into parse_store(), and the former returns 0 on error while for the latter it's a success. This means that some errors on variables of scope "proc" (typically alloc failure) can be missed at boot time, probably either making that variable invisible or causing a crash during boot. Let's return ACT_RET_PRS_ERR instead. This can be backported. --- diff --git a/src/vars.c b/src/vars.c index c8a08b5d5..ea7822770 100644 --- a/src/vars.c +++ b/src/vars.c @@ -1271,7 +1271,7 @@ static enum act_parse_ret parse_store(const char **args, int *arg, struct proxy if (rule->arg.vars.desc.scope == SCOPE_PROC && !var_set(&rule->arg.vars.desc, &empty_smp, VF_CREATEONLY|VF_PERMANENT)) - return 0; + return ACT_RET_PRS_ERR; /* There is no fetch method when variable is unset. Just set the right * action and return. */