From: Willy Tarreau Date: Wed, 23 Sep 2015 10:21:21 +0000 (+0200) Subject: BUG/MEDIUM: stream: do not dereference strm_li(stream) X-Git-Tag: v1.6-dev6~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c1068cb67408ead42f4bbfd34c7479cc9d44512;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stream: 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/stream.c b/src/stream.c index 6c1f7ab84b..5583d1d40e 100644 --- a/src/stream.c +++ b/src/stream.c @@ -934,7 +934,7 @@ static void sess_set_term_flags(struct stream *s) if (s->si[1].state < SI_ST_REQ) { strm_fe(s)->fe_counters.failed_req++; - if (strm_li(s)->counters) + if (strm_li(s) && strm_li(s)->counters) strm_li(s)->counters->failed_req++; s->flags |= SF_FINST_R;