]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: pattern: fix possible infinite loops on deletion (try 2)
authorWilly Tarreau <w@1wt.eu>
Tue, 16 Sep 2025 09:49:01 +0000 (11:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Sep 2025 14:32:39 +0000 (16:32 +0200)
commit3d73e6c818e8b80218b777eafe35412435a1fad3
tree219aa1f5b7e2b4108e562627ed6693e065154e76
parentf1b1d3682a56527f545f90ff77e22f7f6f57c0aa
BUG/MEDIUM: pattern: fix possible infinite loops on deletion (try 2)

Commit e36b3b60b3 ("MEDIUM: migrate the patterns reference to cebs_tree")
changed the construction of the loops used to look up matching nodes, and
since we don't need two elements anymore, the "continue" statement now
loops on the same element when deleting. Let's fix this to make sure it
passes through the next one.

While this bug is 3.3 only, it turns out that 3.2 is also affected by
the incorrect loop construct in pat_ref_set_from_node(), where it's
possible to run an infinite loop since commit 010c34b8c7 ("MEDIUM:
pattern: consider gen_id in pat_ref_set_from_node()") due to the
"continue" statement being placed before the ebmb_next_dup() call.

As such the relevant part of this fix (pat_ref_set_from_elt) will
need to be backported to 3.2.
src/pattern.c