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.
This commit is contained in:
Aurelien DARRAGON 2025-09-15 09:22:19 +02:00
parent b582fd41c2
commit be417c1db2

View File

@ -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 */