BUG/MAJOR: cli: do not dereference strm_li()->proto->name

Or it will crash when dumping streams instanciated by an applet,
like Lua's cosockets.
This commit is contained in:
Willy Tarreau 2015-09-23 12:16:43 +02:00
parent 0fd99094c3
commit f1e0212d54

View File

@ -6011,8 +6011,7 @@ static int stats_dump_sess_to_buffer(struct stream_interface *si)
chunk_appendf(&trash, chunk_appendf(&trash,
"%p: proto=%s", "%p: proto=%s",
curr_sess, curr_sess,
strm_li(curr_sess)->proto->name); strm_li(curr_sess) ? strm_li(curr_sess)->proto->name : "?");
conn = objt_conn(strm_orig(curr_sess)); conn = objt_conn(strm_orig(curr_sess));
switch (conn ? addr_to_str(&conn->addr.from, pn, sizeof(pn)) : AF_UNSPEC) { switch (conn ? addr_to_str(&conn->addr.from, pn, sizeof(pn)) : AF_UNSPEC) {