From 578fa0259f59736496a5f227bbadd2a936dc786f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Nov 2016 15:21:26 +0100 Subject: [PATCH] BUG/MINOR: cli: fix pointer size when reporting data/transport layer name In dumpstats.c we have get_conn_xprt_name() and get_conn_data_name() to report the name of the data and transport layers used on a connection. But when the name is not known, its pointer is reported instead. But the static char used to report the pointer is too small as it doesn't leave room for '0x'. Fortunately all subsystems are known so we never trigger this case. This fix needs to be backported to 1.6 and 1.5. --- src/dumpstats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index e9ae9e885a..e22d0744c4 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -5854,7 +5854,7 @@ static inline const char *get_conn_ctrl_name(const struct connection *conn) static inline const char *get_conn_xprt_name(const struct connection *conn) { - static char ptr[17]; + static char ptr[19]; if (!conn_xprt_ready(conn)) return "NONE"; @@ -5872,7 +5872,7 @@ static inline const char *get_conn_xprt_name(const struct connection *conn) static inline const char *get_conn_data_name(const struct connection *conn) { - static char ptr[17]; + static char ptr[19]; if (!conn->data) return "NONE"; -- 2.47.3