From be417c1db25bdf59a5d288e1feda146df8cd4fb8 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Mon, 15 Sep 2025 09:22:19 +0200 Subject: [PATCH] BUG/MEDIUM: http_ana: fix potential NULL deref in http_process_req_common() As reported by @kenballus in GH #3118, a potential NULL-deref was introduced in 3da1d63 ("BUG/MEDIUM: http_ana: handle yield for "stats http-request" evaluation") Indeed, px->uri_auth may be NULL when stats directive is not involved in the current proxy section. The bug went unnoticed because it didn't seem to cause any side-effect so far and valgrind didn't catch it. However ASAN did, so let's fix it before it causes harm. It should be backported with 3da1d63. --- src/http_ana.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_ana.c b/src/http_ana.c index 72a967d46..b7b0b2f20 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -399,7 +399,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s verdict = HTTP_RULE_RES_CONT; - if (s->current_rule_list == &px->uri_auth->http_req_rules) + if (px->uri_auth && s->current_rule_list == &px->uri_auth->http_req_rules) stats_rules = 1; /* resume stats http-request rules if needed */