]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cfgparse: fix "default" prefix parsing
authorEgor Shestakov <egor@ved1.me>
Thu, 15 Jan 2026 15:41:37 +0000 (15:41 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Jan 2026 08:09:19 +0000 (09:09 +0100)
commit447d73dc99fde7b8ec2e6cc964817ed6563fce5e
tree53f57549e2878382c54042862ca69bc272dc2753
parent362ff2628ff17642a2461d55e30fd7779a13ab33
BUG/MINOR: cfgparse: fix "default" prefix parsing

Fix the left shift of args when "default" prefix matches. The cause of the
bug was the absence of zeroing of the right element during the shift. The
same bug for "no" prefix was fixed by commit 0f99e3497, but missed for
"default".

The shift of ("default", "option", "dontlog-normal")
    produced ("option", "dontlog-normal", "dontlog-normal")
  instead of ("option", "dontlog-normal", "")

As an example, a valid config line:
    default option dontlog-normal

caused a parse error:
[ALERT]    (32914) : config : parsing [bug-default-prefix.cfg:22] : 'option dontlog-normal' cannot handle unexpected argument 'dontlog-normal'.

The patch should be backported to all stable versions, since the absence of
zeroing was introduced with "default" keyword.
src/cfgparse.c