]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: vars: Properly eval set-var-fmt action for emtpy log-format string
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Jun 2026 09:48:16 +0000 (11:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Jun 2026 10:05:56 +0000 (12:05 +0200)
commitd0ab99932a30c17d90f234743541d6c5eb716385
tree1fef6c36a4c063337b95e8aa3c272d6327244368
parent1b4255a885d332a53f73f0849108a7ec2bf6d19c
BUG/MEDIUM: vars: Properly eval set-var-fmt action for emtpy log-format string

When the log-format string was empty, in action_store() function, a fallback was
performed on the expression evaluation, thinking a set-var() was performed.
However, it is possible to have an empty log-format string. At least, on 3.2 and
3.0, it is allowed to parse an empty log-format string, quoted empty string are
not rejected.

So, on 3.2 and 3.0, it was possible to have a "set-var-fmt" action in the config
leading to parse an empty log-format string. Doing so, a crash could be
experienced when the action was executed because the fallback on the expression
evaluation led to dereference a NULL pointer.

To fix the issue, during parsing the action type is now set to a different value
for a "set-var" or a "set-var-fmt" action. And this action type is tested during
execution to perform the right action.

This patch should fix issue #3406. It must be backported as far as 3.0. Only 3.2
and 3.0 are affected by the issue.
src/vars.c