]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: pattern: check for non-empty string before matching regexes
authorWilly Tarreau <w@1wt.eu>
Sat, 21 Nov 2026 07:59:56 +0000 (08:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 21 Nov 2026 07:59:56 +0000 (08:59 +0100)
commit4b348d2a4d528d98b5bb6d925d26e569a4b9509e
tree2d2903b10569ba63cf90fc61c2f8691981992bd9
parent2b7dea07a90b52e075ff49856471613621f5efbe
BUG/MEDIUM: pattern: check for non-empty string before matching regexes

Zübeyir Eser reported in github issue #3602 that passing req.body to the
default regex engine crashes when there is no body. This is because the
body returns an empty sample while the default regex engine demands at
least one byte available to write a trailing zero.

Let's make sure that regex matches don't even run when subject to empty
strings.

This can be backported to all branches.
src/pattern.c