]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http_act: fix deinit performed on uninitialized lf_expr in release_http_map()
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 14 Jan 2026 18:51:40 +0000 (19:51 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 14 Jan 2026 19:05:39 +0000 (20:05 +0100)
commit2ec387cdc2cf4cba4b69b66e27c0221f64e4c99c
tree49d63d963a0bb83aa24b683a99e4de81495b60cb
parent7f4b053b26429754df3094001e375b81cee6895d
BUG/MINOR: http_act: fix deinit performed on uninitialized lf_expr in release_http_map()

As reported by GH user @Lzq-001 on issue #3245, the config below would
cause haproxy to SEGFAULT after having reported an error:

  frontend 0000000
        http-request set-map %[hdr(0000)0_

Root cause is simple, in parse_http_set_map(), we define the release
function (which is responsible to clear lf_expr expressions used by the
action), prior to initializing the expressions, while the release
function assumes the expressions are always initialized.

For all similar actions, we already perform the init prior to setting
the related release function, but this was not the case for
parse_http_set_map(). We fix the bug by initializing the expressions
earlier.

Thanks to @Lzq-001 for having reported the issue and provided a simple
reproducer.

It should be backported to all stable versions, note for versions prior to
3.0, lf_expr_init() should be replace by LIST_INIT(), see
6810c41 ("MEDIUM: tree-wide: add logformat expressions wrapper")
src/http_act.c