]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: filters: check the filter name before comparing it
authorDragan Dosen <ddosen@haproxy.com>
Mon, 31 Aug 2026 22:43:56 +0000 (22:43 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Sep 2026 11:47:07 +0000 (13:47 +0200)
commitefe1099c37c934a2f053e627ac295de40e77ef01
treeaa35aa9ed8abcf58cb3007bfc15fb26f2487b6d1
parentd2a40adda9715c20f5c5e188d5fa5995dc5524e9
BUG/MEDIUM: filters: check the filter name before comparing it

compile_filter_sequence_elt() looks a filter up by name with strcmp(),
without checking whether the filter configuration has a name. Only the
filters declared with the "filter" keyword get one, assigned by
parse_filter(). The filters which the configuration inserts on its own
never go through that function and leave the name NULL, so haproxy can
crash while parsing a configuration which combines a "filter-sequence"
line with any of those, for example:

    frontend f
        bind :8080
        compression algo gzip
        filter-sequence request non-existent

Let's skip the filters which have no name. They cannot be referenced in
a "filter-sequence" line anyway, so the lookup now fails and reports
"invalid filter name".

This should be backported to all branches which have "filter-sequence".
src/filters.c