]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: cli: do not dereference strm_li()->proto->name
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2015 10:16:43 +0000 (12:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2015 11:42:08 +0000 (13:42 +0200)
Or it will crash when dumping streams instanciated by an applet,
like Lua's cosockets.

src/dumpstats.c

index fae9e3fde52a9a005830d9ed0b5bf16f46ad0d9a..39bdd17142bc3631061917a81efa62f357ebd09c 100644 (file)
@@ -6011,8 +6011,7 @@ static int stats_dump_sess_to_buffer(struct stream_interface *si)
                        chunk_appendf(&trash,
                                     "%p: proto=%s",
                                     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));
                        switch (conn ? addr_to_str(&conn->addr.from, pn, sizeof(pn)) : AF_UNSPEC) {