BUG/MEDIUM: http-ana: Clear request analyzers when applying redirect rule
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 4 Oct 2021 12:16:46 +0000 (14:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 4 Oct 2021 16:11:39 +0000 (18:11 +0200)
commit0993832844cb2203b4d778a443b25607996cd7f1
treea69f10c0f1444a7d113b1b9a27d21d485b92fdf5
parentc182a701fa7ef2ca88e7cfb858eaf3392c965601
BUG/MEDIUM: http-ana: Clear request analyzers when applying redirect rule

A bug was introduced by the commit 2d5650082 ("BUG/MEDIUM: http-ana: Reset
channels analysers when returning an error").

The request analyzers must be cleared when a redirect rule is applied. It is
not a problem if the redirect rule is inside an http-request ruleset because
the analyzer takes care to clear it. However, when it comes from a redirect
ruleset (via the "redirect ..."  directive), because of the above commit,
the request analyzers are no longer cleared. It means some HTTP request
analyzers may be called while the request channel was already flushed. It is
totally unexpected and may lead to crash.

Thanks to Yves Lafon for reporting the problem.

This patch must be backported everywhere the above commit was backported.

(cherry picked from commit d34758849e1f7e070a25022fcfe38e4fc82e22c6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 9132227728115431dbf379b9006347c2430d0dda)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_ana.c