]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http: do not dereference strm_li(stream)
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2015 10:18:14 +0000 (12:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2015 11:42:08 +0000 (13:42 +0200)
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.

src/proto_http.c

index 0fb57d39d8b40675c07bd74d2ad14a622cb98297..57cc35487b89c240a2f85988fd10037e8cbf82a0 100644 (file)
@@ -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;
 }