From efe1099c37c934a2f053e627ac295de40e77ef01 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Mon, 31 Aug 2026 22:43:56 +0000 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters.c b/src/filters.c index f118fd0cd..a972c7218 100644 --- a/src/filters.c +++ b/src/filters.c @@ -380,7 +380,7 @@ static int compile_filter_sequence_elt(struct proxy *px, struct filter_sequence_ int ret = ERR_NONE; list_for_each_entry(fconf, &px->filter_configs, list) { - if (strcmp(elt->flt_name, fconf->name) == 0) { + if (fconf->name && strcmp(elt->flt_name, fconf->name) == 0) { elt->flt_conf = fconf; break; } -- 2.47.3