From: Willy Tarreau Date: Wed, 23 Sep 2015 10:20:10 +0000 (+0200) Subject: BUG/MEDIUM: proxy: do not dereference strm_li(stream) X-Git-Tag: v1.6-dev6~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b746329dc37c2b27d0924bc0498ba1d395a68dae;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: proxy: 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/proxy.c b/src/proxy.c index b690a81feb..fb62b7c044 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1141,7 +1141,9 @@ int stream_set_backend(struct stream *s, struct proxy *be) * be more reliable to store the list of analysers that have been run, * but what we do here is OK for now. */ - s->req.analysers |= be->be_req_ana & ~strm_li(s)->analysers; + s->req.analysers |= be->be_req_ana; + if (strm_li(s)) + s->req.analysers &= ~strm_li(s)->analysers; /* If the target backend requires HTTP processing, we have to allocate * the HTTP transaction and hdr_idx if we did not have one.