]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 23 Jun 2025 05:33:06 +0000 (07:33 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Jun 2025 06:04:50 +0000 (08:04 +0200)
commitfb7b5c8a53cb4f19a223abd20660d47162aa8708
tree8b2753109e09b1c6a4a556ddd7ca64fe821d9657
parent68c3eb30135346bf0c0b0a0050326ab262b49134
BUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself

There is nothing that prevent a "unique-id-format" to reference itself,
using '%ID' or '%[unique-id]'. If the sample fetch function is used, it
leads to an infinite loop, calling recursively the function responsible to
generate the unique ID.

One solution is to detect it during the configuration parsing to trigger an
error. With this patch, we just inhibit recursive calls by considering the
unique-id as empty during its evaluation. So "id-%[unique-id]" lf string
will be evaluated as "id-".

This patch must be backported to all stable versions.
src/stream.c