From: Willy Tarreau Date: Thu, 24 Nov 2016 14:21:26 +0000 (+0100) Subject: BUG/MINOR: cli: fix pointer size when reporting data/transport layer name X-Git-Tag: v1.7.0~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=578fa0259f59736496a5f227bbadd2a936dc786f;p=thirdparty%2Fhaproxy.git 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. --- 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";