From: Willy Tarreau Date: Wed, 23 Sep 2015 10:18:14 +0000 (+0200) Subject: BUG/MEDIUM: http: do not dereference strm_li(stream) X-Git-Tag: v1.6-dev6~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c29d0cda4b4502c4e04411cab0205d33a04086d2;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http: do not dereference strm_li(stream) Some streams do not have a listener (eg: Lua's cosockets) so let's check for this. For now this problem cannot happen but it's definitely unsafe. --- diff --git a/src/proto_http.c b/src/proto_http.c index 0fb57d39d8..57cc35487b 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -5284,7 +5284,7 @@ void http_end_txn_clean_session(struct stream *s) si_idle_conn(&s->si[1], &srv->idle_conns); } - s->req.analysers = strm_li(s)->analysers; + s->req.analysers = strm_li(s) ? strm_li(s)->analysers : 0; s->res.analysers = 0; }